You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
🦑
Samuel Chase
samebchase
🦑
I like desert-island programming languages like Raku and Common Lisp.
At work, I write Go (used to be Clojure and Java).
The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.
Only first 1000 GitHub users according to the count of followers are taken.
This is because of limitations of GitHub search. Sorting algo in pseudocode:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
A gist to demonstrate how the redis API can be wrapped in Hystrix.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A proof that the Halting problem is undecidable, using JavaScript and examples
Having read a few proofs that the halting problem is undecidable,
I found that they were quite inaccessible,
or that they glossed over important details.
To counter this, I've attempted to re-hash the proof using a familiar language, JavaScript,
with numerous examples along the way.
This famous proof tells us that there is no general method
to determine whether a program will finish running.
To illustrate this, we can consider programs as JavaScript function calls,
and ask whether it is possible to write a JavaScript function which will tell us
Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.
Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):
The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.
Please note that the article is now on my website, and even though I am still working on it, any feedback is appreciated. Thanks for reading !
On the Quest of recoding malloc(3)
Back when I did not know anything about programing and started to learn C, I was first introduced to pointers (and other dreaded horrors that made me curl into a corner and cry) and dynamic memory in general.
I was baffled, troubled, yet fascinated by the basic explanation on how memory worked, and started to dread the time where I would need to manually create my char arrays for each and every sentences of my program; right before learning about string literals and feeling like an idiot.
It was then where I was learning about memory allocation and came upon a function that I would call for long the "magic function" : malloc.
Magic, because at that point I didn't know how it worked, let alone knew anything about memory other that it was a "chain of boxes for numbers".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters