Skip to content

Instantly share code, notes, and snippets.

@chockenberry
chockenberry / README
Created April 6, 2022 17:32
A simple AppleScript to start up a web server in the folder where the script is located.
1) Add this code to a new file in Script Editor
2) Export the script as "Application" and make sure it's code signed
3) Put "Startup.app" in the root folder of the test website (e.g. where index.html is located)
4) Make sure that "Startup.app" has Full Disk Access in System Preferences > Security & Privacy > Privacy
@ssylvan
ssylvan / rh_hash_table.hpp
Last active January 12, 2023 04:52
Quick'n'dirty Robin Hood hash table implementation. Note, I have implemented this algorithm before, with tons of tests etc. But *this* code was written specifically for the blog post at http://sebastiansylvan.com/post/robin-hood-hashing-should-be-your-default-hash-table-implementation/, it has not been extensively tested so there may be bugs (an…
#define USE_ROBIN_HOOD_HASH 1
#define USE_SEPARATE_HASH_ARRAY 1
template<class Key, class Value>
class hash_table
{
static const int INITIAL_SIZE = 256;
static const int LOAD_FACTOR_PERCENT = 90;
struct elem