Programming Leftovers
-
Unix Men ☛ Bash For Loop: A Complete Guide for Perfect Scripts
-
Unix Men ☛ Git Rename Branch—Why, How, and Precautions
When multiple team members or a single user work on different aspects of a single piece of code simultaneously, Git branches come to the rescue. Git branches allow for separate development efforts, such as bug fixes, improvements, or experiments, without affecting the main production code. Effective Git branch management includes knowing how to rename branches, which we will cover in this article, along with the necessary precautions.
-
Buttondown ☛ I've been thinking about tradeoffs all wrong
I don't know if this framing was intentional on the speaker's part, but I like it so much more. What's the difference? Even if you pick the least-bothersome drawback, you still have a drawback. Going back to the SQS vs SNS example, let's say you hate the how hard adding new services to SQS is, so you switch to SNS. Then you realize it hard to do access-control, and this is a worse problem than the SQS problem was. So the right tradeoff is to go back to using SQS.
But now it's hard to add new services again. And that sucks! You don't get to stop thinking about the pros and cons just because you made a decision. There's still a problem you have to deal with.
-
Sean Conner ☛ Just a simple matter of replacing a slow Lua function with a faster C function
I spent the past few days rewriting some Lua code into C. While I find LPEG to be convenient, it is not necessarily fast. Normally this isn't an issue but in this case, I was calling LPEG for each character in a blog post.
-
Kev Quirk ☛ Improving My Watch Log
For example, the original version couldn't display the watch I'm wearing today. Instead, it would just dump a random watch from the collection on every page refresh, which was a little...random.
I've managed to fix this so that when I choose a watch to wear, that "card" stays until I decided to generate a new watch, and confirm that I'm wearing it, the next day.
While I was there, I also wanted to add a notice that shows me the last time I wore a watch according to the log. If there's no entries in the log, it also needed to have an elegant message.
-
Yoshua Wuyts ☛ Context Managers: Undroppable Types for Free
In program language design I'm a big fan of features which fall out of other, more general features. People occasionally talk about both "unleakable" and "undroppable" types. I see a lot of value in "unleakable" types because if a type is "unleakable" we can guarantee the type will always have its destructor called. This would allow us to use Drop to be used to uphold safety invariants, which will make it possible to write things like "task scopes". For type system nerds: yes, this means Rust would be able to uphold linear invariants via its type system, AKA equip Rust with linear types.
-
DataGeeek ☛ Causal Inference: Technology Stocks Surge – DataGeeek
As seen in the above results, the relative effect shows that 66% increase which means the observed values are 66% higher than the counterfactual values which denotes how the response variable would have evolved if the intervention had never occurred. The result is significant because 95% confidence intervals(CI) exclude 0.
Finally, we will draw a plot showing the results we mentioned above.
-
Armin Ronacher ☛ Your Node is Leaking Memory? setTimeout Could be the Reason | Armin Ronacher's Thoughts and Writings
This is mostly an FYI for node developers. The issue being discussed in this post has caused us quite a bit of pain. It has to do with how node deals with timeouts. In short: you can very easily create memory leaks [1] with the setTimeout API in node. You're probably familiar with that API since it's one that browsers provide for many, many years. The API is pretty straightforward: you schedule a function to be called later, and you get a token back that can be used to clear the timeout later. In short: [...]
-
Python
-
Hackaday ☛ USB Dongle Brings Python-Controlled GPIO To The Desktop
Microcontroller dev boards are wonderfully useful items, in testament to which most of us maintain an ample collection of the things. But dragging one out to do a simple job can be a pain, what with making sure you have the whole toolchain set up to support the device, not to mention the inevitable need to solder or desolder header pins. Wouldn’t it be nice if there was a simple plug-and-play way to add a few bits of GPIO to your desktop or laptop machine?
-
Mat Duggan ☛ Simple Kubernetes Secret Encryption with Python
I was recently working on a new side project in Python with Kubernetes and I needed to inject a bunch of secrets. The problem with secret management in Kubernetes is you end up needing to set up a lot of it yourself and its time consuming. When I'm working on a new idea, I typically don't want to waste a bunch of hours setting up "the right way" to do something that isn't related to the core of the idea I'm trying out.
-
James G ☛ Polling feeds without writing feed parsing logic
I have been working on a feed reader for academic research. This project has been divided into four main parts: identifying data sources, aggregating data, defining a user experience, and ranking information retrieved from data sources.
-
-
Shell/Bash/Zsh/Ksh
-
Audiocasts/Shows
-
Hackaday ☛ FLOSS Weekly Episode 786: What Easy Install Script?
This week Jonathan Bennett and Rob Campbell chat with Brodie Robertson about Linux, Wayland, YouTube, Microsoft’s Windows Recall and more. Is Linux ready for new users? Is Recall going to kick off a migration? All this and more!
-
-
-
Standards/Consortia
-
James G ☛ Notes on responsible web crawling
One challenge in particular when running search engines is ensuring that your search engine doesn't break someone's website. For example, suppose you are indexing a personal website. If your logic to parse URLs is incorrect, your crawler may spiral out of control and start crawling many pages that don't exist. A potential side-effect of this is that you put undue burden on someone's server, causing their site to be slower.
This is why I outlined an indie web search engine that works by reading feeds rather than crawling (also called "spidering".
-
Harry Cresswell ☛ Slash pages and /slashes
It’s not always clear which slash pages exist when you visit a website. Unless they’re all listed in a navigation somewhere – which invariably they aren’t. So listing them on their own dedicated page is extremely helpful.
-