Skip to content

Instantly share code, notes, and snippets.

@dhh
dhh / linux-setup.sh
Last active July 31, 2025 19:20
linux-setup.sh
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT.
#
#
# Libraries and infrastructure
sudo apt update -y
sudo apt install -y \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
@dcyou
dcyou / gist:06a4f6e0a770887fbd01fa8276b945c0
Created March 23, 2017 13:13 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
$ ssh -A vm
$ git config --global url."[email protected]:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "[email protected]:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
@vibin
vibin / OpenInSafari.scpt
Created January 20, 2017 05:51
Open Chrome's Current URL in Safari
tell application "Google Chrome"
set visibleUrl to get URL of active tab of window 1
end tell
tell application "Safari"
open location visibleUrl
activate
end tell
@svermeulen
svermeulen / MultiSceneSetup.cs
Created October 23, 2016 17:32
Simple editor script to save and load multi-scene setups within Unity3D
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEditor.SceneManagement;
using UnityEditor;
using System.Collections;
using System.Linq;
public class MultiSceneSetup : ScriptableObject
{
@pervognsen
pervognsen / BTree.cpp
Created April 24, 2016 20:40
A B+-tree implementation with find, insert and delete in 176 lines of code.
enum { BMAX = 32, BMIN = BMAX / 2, BHEIGHT = 6 };
struct BNode {
uint32_t length;
Key keys[BMAX];
union {
BNode *children[BMAX];
Value values[BMAX];
};
};
@kevingo
kevingo / docker-web-app.md
Last active January 26, 2016 13:41
Dockerizing a Node.js web app
@yocontra
yocontra / InstaxProtocol.java
Created July 7, 2015 07:32
Instax SP-1 Android Source
package com.Instax.sdk;
import java.io.*;
import java.util.*;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.Color;
import android.util.Log;
import com.Instax.sdk.InstaxStatus.ErrCode;
@gornostal
gornostal / README.md
Last active June 7, 2019 16:20
Install Hackintosh OS X Yosemite on Sony Vaio VPC-F11M1R/H

Successfully installed OS X Yosemite on my Sony VAIO F11M1R/H.

Problems:

  • I had to buy USB sound card for $10 (Viewcon VE533 works for me), because I couldn't find audio drivers.
  • OS X won't connect to password protected Wi-Fi networks, so I had to remove a password.

So here's the steps that I followed:

  1. Make a bootable flash drive using UniBeast tool
//#define DEBUG_THREADING
using UnityEngine;
using System.Collections;
using System.Threading;
using System.Reflection;
public delegate IEnumerator MonitorCoroutine<T> (CoroutineData<T> data);
@leifwalsh
leifwalsh / A_results.txt
Last active September 19, 2020 13:49
mcs lock: userspace c++11 implementation of http://lwn.net/Articles/590243/. seems to be awful---far worse than normal spinlock---with nthreads > ncpus
# clang version 3.4 (tags/RELEASE_34/final)
# Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
spinlock 1: 3925ms
spinlock 2: 25665ms
spinlock 3: 27722ms
spinlock 4: 42727ms
std::mutex 1: 5526ms
std::mutex 2: 17672ms
std::mutex 3: 31038ms
std::mutex 4: 36890ms