Skip to content

Instantly share code, notes, and snippets.

View tomgco's full-sized avatar
☠️
Building stuff

Tom Gallacher tomgco

☠️
Building stuff
View GitHub Profile
@tomgco
tomgco / raspberrypi.patch
Created May 10, 2012 12:33
Raspberry Pi V8 Patch
@@ -79,8 +79,8 @@
},
'gcc': {
'all': {
- 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
- 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'],
+ 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS', '-march=armv6'],
+ 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions', '-march=armv6'],
},
'visibility:hidden': {
{ "jshint_options":
{ "browser": true
, "curly": true
, "devel": true
, "eqeqeq": true
, "eqnull": true
, "es5": false
, "evil": false
, "immed": false
, "jquery": true
@tomgco
tomgco / bench.sh
Created April 10, 2013 16:40
Apache-bench graphs
#!/bin/bash
NAME=$1
# node ../../PersonalSite/app.js &
pid=$!
bench() {
ab -n 6000 -c 40 -g out-$NAME.graph -H "Accept-Encoding: gzip" "http://127.0.0.1:3021/main/js/lib/v0.1.0/jquery-1.7.2.min.js"
}
sleep 2
void
HMAC_SHA1_Init(HMAC_SHA1_CTX *ctx, const u_int8_t *key, u_int key_len)
{
u_int8_t k_ipad[SHA1_BLOCK_LENGTH];
int i;
if (key_len > SHA1_BLOCK_LENGTH) {
SHA1Init(&ctx->ctx);
SHA1Update(&ctx->ctx, key, key_len);
SHA1Final(ctx->key, &ctx->ctx);
@tomgco
tomgco / gist:6107598
Created July 29, 2013 20:38
Git repo one week ago
WEEKDATE=`date -f "%Y-%m-%d 13:37" -d '1 week ago'` git checkout `git rev-list -n 1 --before=$WEEKDATE develop`
[email protected] /private/tmp/terminal-codelearn
├── [email protected]
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
@tomgco
tomgco / a.js
Created September 9, 2013 18:33
var v8 = require('strong-cpu-profiler')
, fs = require('fs')
v8.startProfiling('a')
console.log('a')
var profile = v8.stopProfiling('a')
fs.writeFileSync('a.nom', JSON.stringify({
title: profile.title,
uid: profile.uid,
@tomgco
tomgco / Clock Data.md
Last active December 29, 2015 11:39
BSON performance

BSONNative.BSON:

====================== 700 :: 0.07

BSONPure.BSON:

====================== 1991 :: 0.1991
@tomgco
tomgco / guidlines.md
Last active January 3, 2016 03:38
Git Commit Guidlines

COMMIT

Make sure git knows your name and email address:

$ git config --global user.name "J. Random User"
$ git config --global user.email "[email protected]"

Writing good commit logs is important. A commit log should describe what