Skip to content

Instantly share code, notes, and snippets.

@willurd
willurd / web-servers.md
Last active November 10, 2025 16:13
Big list of http static server one-liners

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.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@ghl3
ghl3 / _ImmutableDatabase
Last active October 24, 2024 13:50
Implementation of an immutable database in postgres
We couldn’t find that file to show.
@aesmail
aesmail / phoenix_channels_nativescript.md
Last active November 8, 2018 12:11
NativeScript + Phoenix Channels

I have been struggling (unnecessarily) to make my NativeScript app work seamlessly with Phoenix Channels.

I'm sure this is not the perfect solution, but after trying a lot of other solutions and none of them worked, this one worked for me like a charm.

I'm using:

  • macOS 10.12.6
  • phoenix 1.3.0
  • NativeScript 3.1.3
@cigzigwon
cigzigwon / auth.ex
Created November 17, 2020 17:02
NS OAuth 1.0a Token Based Auth
@oauth_creds [
realm: "#{@acct_id}",
oauth_consumer_key: "<CONSUMER_KEY>",
oauth_consumer_secret: "<CONSUMER_SECRET>",
oauth_token: "<TOKEN>",
oauth_token_secret: "<TOKEN_SECRET>",
oauth_signature_method: "HMAC-SHA256",
oauth_version: "1.0"
]
@SupaMic
SupaMic / compiling.md
Last active August 14, 2025 19:08
Compiling NIFs on Windows

Compiling bcrypt_elixir or argon2_elixir on a Windows machine in 2022

I'm going outline the full process and what I can decipher is the reasoning behind each step of this process for successfully compiling the bcrypt_elixir or argon2_elixir dependencies on a Windows machine in the hopes that when inevitably Microsoft changes where and how they package build libraries, Elixir devs will have a better understanding when they try to troubleshoot.

The cause of all this headache is that bcrypt_elixir and argon2_elixir are actually just wrappers around C++ implementations of these password hashing algorithms implemented in NIFs (Native Implemented Functions). Some C++ NIF background [https://andrealeopardi.com/posts/using-c-from-elixir-with-nifs/] A peek at C code in the bcrypt_elixir repo [https://github.com/riverrun/bcrypt_elixir/tree/master/c_src]

Before I go ahead I want to implore the Elixir community to collaborate and build native implementations of these or similar password hashing algorithms because the