1. 1

    Virtualenv supposed to be disposable. Using tools like poetry you just recreate the env and rerun poetry install. As long as poetry itself not within virtualenv but using python from brew directly it should not be affected by the upgrade. I see there’s brew formulae for poetry.

    Btw this post caught my eye because I wrote with similar title long time ago :)

    1. 25

      The article focuses on followers, which is a strange metric to focus on.

      github primarily allows physically separated developers, sometimes from different organizations, to collaborate on code.

      As a side effect, github offers the possibility to show a portfolio of work. This is possible for people whose work/study allows them to show the work they did publicly including collaboration.

      If a person does have material on github and points to it on their resume, you can get an idea of their working style, and some of their personality from this portfolio. It may help you to filter candidates and to think of things to ask them in the interview that will spark a nice discussion.

      Once, in an interview I had a nice discussion with a total stranger about an orbital simulator I’ve worked on for many years, totally unrelated to the work at hand.

      If the candidate doesn’t have a github portfolio, it is what it is and you’ll just have to ask them about what they like to code in the interview.

      Like everything else, a github portfolio is just one piece of evidence to a future colleague’s fit for a job. It’s neither a necessary piece of evidence, nor a sufficient one, to hinge a hiring decision on.

      1. 4

        “a (github) portfolio is just one piece of evidence to a future colleague’s fit for a job. It’s neither a necessary piece of evidence, nor a sufficient one, to hinge a hiring decision on.”

        I absolutely agree, it can add the necessary part of the information, but it certainly does not help to draw the whole personality profile of the candidate, it is necessary to evaluate many more factors.

        1. 3

          They did include this footnote:

          There isn’t an API to get the contribution activity in the last year from GitHub. Instead, people seem to get the timeline image as an SVG (like hitting this endpoint https://github.com/users/benfred/contributions), and then parse the SVG to get the number of contributions. I almost went with this hack for this post but hit some problems with CORS restrictions from loading this in the browser. I could have written a proxy to host the requests, but it was getting silly so went with the number of followers instead.

          1. 10

            One thing I usually did when evaluating candidate is to search for “site:github.com username commented on”. That will give some ideas on the candidate communication style as we go through his interaction on github discussing bugs, suggesting new features or debating on some technical arguments.

            1. 2

              This is not a bad idea! I just checked some of people I like to work with and the results were great. In case a person did not have any interactions you have to rely on other means.

            2. 3

              Confused. Why would anyone care about those silly metrics when you can look directly at the code they have written? It’s not GitHub, it’s what you put in there. You could host your code on another website, including one that you own, if you have one.

              “Why won’t your CV help you with hiring”…It sure depends on its contents…?

              1. 1

                99% of the code I have written is not available for review for you. How do we proceed?

                1. 4

                  Certainly not by counting GitHub stars or followers.

                  You either have the code to show or you don’t. It’s up to you to prove yourself as a candidate. I would certainly not hire you based a social network metrics.

                  If you want to know that the most followed person on GitHub says about that (I learned this in this entry):

                  Talk is cheap, show me the code.

              2. 2

                There is an API to get contributions. I keep a log in Vim, and I’ve configured it so that pressing F5 inserts a markdown-formatted list of my GitHub contributions since the last time I pressed F5 (https://github.com/talex5/get-activity). I haven’t tried getting a whole year’s worth, but I don’t see why it wouldn’t work.

            1. 9

              I agree, but I find it annoying that it’s a “feature” in test frameworks. A “parameter” is something that a function provides, and every language has functions.

              Basically the problem is that test frameworks want to control the “main” and have a somewhat rigid view of testing.

              I just use a shell script to run the same test twice with different parameters (two different versions of the binary). I’m using a shell function with “parameters”, but you can also use env vars.


              If I’m unit testing in Python, I’ll also just write an explicit loop rather than using weird test framework features.

              1. 3

                If I’m unit testing in Python, I’ll also just write an explicit loop rather than using weird test framework features.

                I find it helpful to unroll the loop: that way the stack trace tells you which example input failed.

                examples = [
                    ("", 0),
                    ("asdf", 4),
                    ("asdfzxcv", 8),
                for input, output in examples:
                    # This line failed, but which loop iteration was it?
                    test_it(input, output)


                test_it("", 0)
                test_it("asdf", 4)    # This line failed :)
                test_it("asdfzxcv", 8)
                1. 3
                  1. 1

                    Great tips! We’re using nosetest generated test for this. In above case, it will generate 3 tests.

                  2. 1

                    The C++ unit testing framework catch has logging macros which take scope into account, meaning you can log the current state in each of your nested loops, but it will only print it out when a test fails: https://github.com/catchorg/Catch2/blob/master/docs/logging.md#top

                  3. 2

                    In rspec, the parameter feature lets you have default values for the whole suite (near the top of the file) while specifying overrides closer to where they are used.

                    That’s the only time I have encountered a feature like that and thought “yes, this is better than a function call”.

                    1. 2

                      I too quite liked that feature in rspec, but the more I use it, the more I think more flexible scope in Common Lisp is better. Rather than being a feature of the test harness, it’s a language feature:

                      CL-USER> (defvar *id* 42 "The default ID we will override in tests")
                      CL-USER> (defun make-entity () (list :id *id*))
                      CL-USER> (equal
                                 '(:id 42))
                      CL-USER> (let ((*id* 43))
                                   '(:id 43)))
                      CL-USER> (equal
                                 '(:id 42))
                      1. 1

                        While I’m enthusing about Common Lisp, the language supports a similar approach to functions:

                        CL-USER> (ql:quickload :cl-smtp)
                        To load "cl-smtp":
                          Load 1 ASDF system:
                        ; Loading "cl-smtp"
                        CL-USER> (flet ((cl-smtp:send-email (&rest _) (declare (ignore _)) "200 Success"))
                                   (cl-smtp:send-email "mail.example.com" "from@example.com" "to@example.com" "subject" "body"))
                        "200 Success"

                        I forget who once said “patterns are what you do when you run out of language” … there’s a similar thing going on here with test harnesses.

                        There are good, feature-rich, test harnesses and mocking/stubbing libraries for Common Lisp. But the language is powerful enough to make their implementation easier than in many other languages. And you can use the same concepts to make your own code more powerful.

                    1. 1

                      I use telegram. Easy sync between devices. Support markdown. Also using it as bookmarks. I created private channels such ad politics, education, tech, coding etc.

                      1. 2

                        It really can restore states? Long time screen user and if that’s true, I’m sold.

                        1. 6

                          Send SMS [in the US] using python (Without Twilio)


                          I think these kind of SMTP to SMS gateways are common in North America but, for example, I don’t think any Australian mobile carriers offer them. Unsure about how common they are in the rest of the world, but wikipedia only mentions US & Canada.

                          Believe the reason they don’t exist in countries like Australia is that subscribers have never paid to receive SMS here (sender pays). So there’s never been an incentive for a carrier to offer such a thing.

                          1. 6

                            Thanks for the clarification. After reading the short text I was left with the question how the payment would be performed (if the mobile number would not be somehow tied to the SMTP login before-hand). From the other perspective: Isn’t a receiver pays scheme together with these SMTP gateways the perfect way to get DOS’ed (in regards of money). Someone just has to send thousands of SMS to you and at some point either your prepaid money will be empty or you will have a very huge invoice.

                            In Europe I have used smstools for sending SMS with a USB-SIM-Card adapter. This comes with a daemon that monitors a folder for text files. When a new text file arrives, it will process it and send it out. So from Python it’s then simple enough to send out an SMS by writing a text file.

                            1. 4

                              Isn’t a receiver pays scheme together with these SMTP gateways the perfect way to get DOS’ed (in regards of money). Someone just has to send thousands of SMS to you and at some point either your prepaid money will be empty or you will have a very huge invoice.

                              I also wondered how this part works, maybe some Americans who know about a bit about the telco industry can explain?

                              (I’m also not sure if any US carriers still charge to receive SMS, I just know that they used to - I think now it’s usually a bundled free addon.)

                              1. 2

                                American here. You’re correct in that most US carriers no long charge for text messages, but rather lump it in with monthly bandwidth limits. When carriers did charge for texts, it was back in the pre-smartphone era, and still fairly new, and I wasn’t aware of any large scale DDOSing. However, it was always flawed, in that your friend could text you a bunch a you’d get charged a lot. I remember a lot of telling people to stop texting or shutting off my phone near the end of the month.

                            2. 2

                              I quickly researched and it seems that in Austria (not Australia) a similar (but different) email to SMS gateway also exists - e.g. in the email Business Package from A1. It’s charged per SMS sent.

                              There is no documentation, but to my understanding you basically login to your A1 e-mail account normally and then send an e-mail to [number]@smssenden.at. They will then detect “aha, this e-mail actually is an SMS” and re-route it for you. So unlike in the US way explained in the article you always use smssenden.at as destination and A1 will handle whatever carrier the recipient has.

                              1. 2

                                From Malaysia. Back in early 2000, this is trick we use to send sms for free. But these days I don’t think any of the local carrier has that email address open anymore.

                                1. 1

                                  I am surprised I didn’t know you had to pay for sms outside US

                                  1. 1

                                    You usually don’t need to pay for SMS these days, it’s included as a free add-on from most carriers (at least in Australia and most countries I’ve ever visited).

                                    The point is that in the US you used to have to pay to send and receive SMS, but in some other countries you only ever had to pay to send. And my understanding is that these SMTP carrier gateways exist from this time. Less clear that the carriers would have an incentive to add them now, if they didn’t already exist (harder to take something away after customers have been relying on it for almost two decades).

                                1. 6

                                  Great list, REFL.me is new to me and super cool. I can vouch for a number of these. I’m running Dokku in production hosting five containers on one machine with 2GB of RAM, something you wouldn’t be able to do with Kubernetes. If you’re willing to give up HA and load balancing, Dokku is a great choice.

                                  I see Vultr recommended a lot and they do have a really low price point, but be aware the $2.50 plan does not include an IPv4 address. To get their lowest-end server with an IPv4 address, it’s actually $3.50. Once you get into the $5/mo plan, they line up exactly with DigitalOcean’s pricing on CPUs/RAM but disk and transfer might a bit different. It’s worth comparing if you really need that (for example) extra 1TB of transfer DO gives you for the same money. You probably don’t but your milage may vary.

                                  I probably don’t need to mention it to Lobste.rs, but cron jobs can and do fail and they fail silently by default. If you really need that cron job to run, it’s worth setting up some kind of monitoring for it. Cron offers a ‘mailto’ option which is easy and good enough for hobby projects.

                                  1. 5

                                    For cron jobs I’ve been using healthchecks.io lately to get a notification if a cron job fails. The free tier is very generous and you can also host it yourself. I think I’ve stumpled upon this tool in some other discussion here.

                                    1. 4

                                      At the risk of turning this into a “everyone recommend your favorite VPS” thread, I’ve been giving lobste.rs sponsor prgmr a go recently. They’re surprisingly helpful and responsive on their IRC channel, and the pricing is on par with DO and others.

                                      1. 2

                                        for load balancing, you can put the dokku servers behind a load balancer (we use ELB), and then write a simple python script to help pushing to all the instances.

                                      1. 7

                                        Note: This is a new thing, not the well-established distributed message client named ‘patchbay’ which connects to ‘pubs’.

                                        Naming things is hard.

                                        1. 3

                                          Convenience link for those who might be curious about the Scuttlebutt Patchbay: https://github.com/ssbc/patchbay

                                          Yeah, I came here to learn about new functionality of SSB Patchbay, especially because of the .pub TLD.

                                          1. 2

                                            That make two of us.

                                        1. 1

                                          Didn’t know about “skip locked” yet. Interesting.

                                          1. 1

                                            We implement something similar with “skip locked” based on this - https://www.holistics.io/blog/how-we-built-a-multi-tenant-job-queue-system-with-postgresql-ruby/.

                                            The difference is that we’re polling postgres for new job instead of using subscribe/notify. But reading the comments on HN, it seems that even with using notify/subscribe you still need to poll on start to check for any unprocessed jobs (in the event where the worker crash when the job was submitted). So I don’t see much value yet to replace the polling.

                                            Our implementation is in python, using multiprocessing (pebble library) for the worker. The main motivation for us to implement it in postgresql (we’re using django-q with sqs before that) is to have rate limit per user, something I found lacking (or non-trivial) in many other job queues like celery.

                                          1. 1

                                            We use buildout and make it a standard practice that python interpreter should be invoked as ./bin/python if in development. While in production, all notes should mention absolute path /app/project/bin/python to remove any ambiguity.

                                            1. 2

                                              Zulip add type to their models using the comment syntax.