Skip to content

Instantly share code, notes, and snippets.

View rsms's full-sized avatar

Rasmus rsms

View GitHub Profile
4 dI vit majonnäs
2 ½ dl vatten
1 dl chilisås
1 ½ tsk vitlökspulver
½ tsk salt
1 tsk oregano
1 tsk dragon
1 tsk paprikapulver
½ tsk cayennepeppar
typedef enum {
CMD_INT = NODE_INT,
CMD_NEG = NODE_NEG,
CMD_NOT = NODE_NOT,
CMD_ADD = NODE_ADD,
CMD_SUB = NODE_SUB,
CMD_RET = 128,
CMD_SETREF,
CMD_GETREF,
} Cmd;

Fixing macOS 10.14, 10.15, 12

Dark main menu without the rest of dark mode

  1. Set Light mode
  2. defaults write -g NSRequiresAquaSystemAppearance -bool Yes
  3. Log out and log back in
  4. Set Dark mode

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
@roxlu
roxlu / main.cpp
Created November 2, 2012 09:46
OpenSSL + LibUV: client https
#include <iostream>
#include <libgen.h>
#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/pem.h>
#include <uv.h>
#include <vector>
#include <iterator>
#include <algorithm>
@dabrahams
dabrahams / constexpr_demo.cpp
Created December 11, 2011 01:29
Fun with C++11 constexpr
#include <iostream>
#include <iomanip>
//
// Utilities
//
// RETURNS() is used to avoid writing boilerplate "->decltype(x) { return x; }" phrases.
//
// USAGE: auto function(<arguments>) RETURNS(<some-expression>);
//
@filsinger
filsinger / fnv_hash_example.cpp
Created October 1, 2011 06:36
C++11 : FNV-1 and FNV-1a compile-time string hashing
// C++11 32bit FNV-1 and FNV-1a string hasing (Fowler–Noll–Vo hash)
//
// Requires a compiler with C++11 support
// See main(...) for examples
#include <iostream>
#include <cassert>
namespace hash
{