Skip to content

Instantly share code, notes, and snippets.

Avatar
🌍
Lower Your Eyelids To Die With The Sun

Tomas Carnecky wereHamster

🌍
Lower Your Eyelids To Die With The Sun
View GitHub Profile
View gist:41609f079dd1851b678a
git for-each-ref --format='%(refname)' refs/heads/ | while read ref; do git log --oneline $ref | tail -n 1; done
View keybase.md

Keybase proof

I hereby claim:

  • I am wereHamster on github.
  • I am werehamster (https://keybase.io/werehamster) on keybase.
  • I have a public key whose fingerprint is A077 7880 A5E5 97BD A192 2151 68B9 B79C 5167 3CF5

To claim this, I am signing this object:

View gist:2608a5f774edf8d334be
"4ornsGrsjsgww" - 4
"JMEbIqDYGdrZn" - 3
"TZJIrIkqExIEc" - 1
"GpIVJIsEmX8mF"
"7dQEIw6BbArDV"
"WxPUtdG2S2OYm"
"RmxkZuJIYiHGK" - 2
"DWUipRQnSOoFM"
View git-flush
#!/bin/sh
# The job of git-flush is to recompactify your repository to be as small
# as possible, by dropping all reflogs, stashes, and other cruft that may
# be bloating your pack files.
git for-each-ref --format="%(refname)" refs/original/ | \
xargs -n 1 git update-ref -d
git reflog expire --expire=0 --all
View 001-Properly-export-js_DateClass-and-js_RegExpClass.patch
From 2f17924139f7add5c66a30c91996f347160f2b2f Mon Sep 17 00:00:00 2001
From: Tomas Carnecky <tom@dbservice.com>
Date: Sat, 5 Jun 2010 11:23:26 +0200
Subject: [PATCH] Properly export js_DateClass and js_RegExpClass, they are needed by mongodb
---
js/src/jsdate.cpp | 2 +-
js/src/jsdate.h | 2 +-
js/src/jsregexp.cpp | 2 +-
js/src/jsregexp.h | 2 +-
View test.cc
#include <v8.h>
#include <node.h>
#include <iostream>
using namespace v8;
static void init (Handle<Object> target) {
int i;
for (i = 0; i < 10000000; ++i) {
@wereHamster
wereHamster / git-svn-cherry-pick
Created Nov 9, 2010
Cherry-pick a svn commit and add a 'Merged from rX' message at the bottom
View git-svn-cherry-pick
#!/bin/sh
# $1 commit to cherry-pick
# $2 branch to apply it to (optional)
#
# Example usage:
# git svn-cherry-pick HEAD release-5.4
# rake test:all && git svn dcommit
commit="$(git rev-parse "$1")"
View package-addon.sh
#!/bin/sh
#
# This relies on addons specifying the external dependencies in their toc file.
# Blizzard conveniently ignores everything after the first space in the
# OptionalDependency field so we can use something like this:
#
# ## OptionalDependency: FooLibrary git@github.com:you/FooLibrary.git deadbeef:Lib/
#
# Where deadbeef:Lib/ is the tree-ish we want to extract and put into Libs/FooLibrary.
#
@wereHamster
wereHamster / bash-git-prompt
Created Jan 15, 2011
My old bash git prompt
View bash-git-prompt
__git_branch () {
local b
if ! b="$(git symbolic-ref HEAD 2>/dev/null)"; then
if ! b="$(git describe --exact-match HEAD 2>/dev/null)"; then
b="$(git rev-parse 2>/dev/null | cut -c1-7)..."
fi
fi
echo "$b"
@wereHamster
wereHamster / import-from-tumblr.js
Created Feb 27, 2011
Slightly modified script to import posts from tumblr into jekyll. Based on rsms' version from his rsms.github.com repo.
View import-from-tumblr.js
var HOSTNAME = 'blog.caurea.org'
var DST_DIR = '/Users/tomc/blog/_posts'
var POST_LAYOUT = 'post'
var DRY_RUN = false
var TAGS_FILTER = function (tag) { return true; }
var TAGS_MAPPER = function (tag) { return tag.toLowerCase(); }
var CUSTOM_FRONT_MATTER = function (post) {
return {
tumblr_id: post.id,