Skip to content

Instantly share code, notes, and snippets.


Simon Eskildsen sirupsen

View GitHub Profile
anonymous / what.rb
Created Aug 27, 2013
View what.rb
require 'yaml'
yaml =
YAML::ENGINE.yamler = 'psych'
puts YAML.load(yaml)
YAML::ENGINE.yamler = 'syck'
puts YAML.load(yaml)
dypsilon /
Last active Jan 25, 2023
A badass list of frontend development resources I collected over time.
sirupsen / hosts.focus
Created Mar 13, 2013
My /etc/hosts and the accompanying crontab.
View hosts.focus
# Host Database
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
## localhost broadcasthost
::1 localhost
fe80::1%lo0 localhost
View turbo.cpp
using namespace std;
funny-falcon /
Last active May 27, 2021
Performace patch for ruby-1.9.3-p327


  • this version includes backport of Greg Price's patch for speedup startup .

    ruby-core prefers his way to do thing, so that I abandon cached-lp and sorted-lf patches of mine.

  • this version integrates 'array as queue' patch, which improves performance when push/shift pattern is heavily used on Array.

    This patch is accepted into trunk for Ruby 2.0 and last possible bug is found by Yui Naruse. It is used in production* for a couple of months without issues even with this bug.

sirupsen / fast.cpp
Created Oct 18, 2012
Code for my competitive programming talk in C++ and Javascript. It solves the "Mega Inversion" problem from NCPC 2011:
View fast.cpp
using namespace std;
typedef long long ll;
ll n;
vector<int> numbers;
struct Tree {
mislav / easy_way.rb
Last active May 20, 2020
RESOLVE SHORT URLS before storing. Short URLs are for microblogging; you should never actually keep them around.
View easy_way.rb
require 'net/http'
# WARNING do not use this; it works but is very limited
def resolve url
res = Net::HTTP.get_response URI(url)
if res.code == '301' then res['location']
else url.to_s
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

mislav / gist:3313773
Created Aug 10, 2012
hosting one's own email
View gist:3313773

I want to get off Gmail for two reasons:

  1. my own * address
  2. to get my email under my own control so I can write scripts to process/analyze it

I've asked on Twitter what software should I use.
Here are the aggregated suggestions.


erikh /
Created Mar 31, 2012 — forked from DAddYE/
OSX For Hackers
#!/usr/bin/env sh
# This is script with usefull tips taken from:
# install it:
# curl -sL | sh