Skip to content

Instantly share code, notes, and snippets.

@tmpvar
tmpvar / context.stop.patch
Created April 23, 2011 14:22
magic sauce to avoid jsdom memory leaks
diff --git a/src/node_script.cc b/src/node_script.cc
index ce7761d..1730671 100644
--- a/src/node_script.cc
+++ b/src/node_script.cc
@@ -57,6 +57,9 @@ class WrappedContext : ObjectWrap {
WrappedContext();
~WrappedContext();
+ void Dispose();
+
@jjb
jjb / gist:950975
Created May 1, 2011 23:16
Using whenever with capistrano and bundler in multiple environments
We couldn’t find that file to show.
@thattommyhall
thattommyhall / mongodb upstart.sh
Last active January 12, 2017 22:04
Automatically run --repair if necessary when starting MongoDB via Upstart
limit nofile 20000 20000
kill timeout 300
env MONGO_DATA=/var/lib/mongodb/
env MONGO_LOGS=/var/log/mongodb/
env MONGO_EXE=/usr/bin/mongod
env MONGO_CONF=/etc/mongodb.conf
pre-start script
@thattommyhall
thattommyhall / hive_info.rb
Created May 16, 2011 16:35
Get filecount, total size, average filesize for Hive tables
current = ''
file_count = 0
total_size = 0
output = File.open('output.csv','w')
IO.popen('hadoop fs -lsr /user/hive/warehouse').each_line do |line|
split = line.split(/\s+/)
#permissions,replication,user,group,size,mod_date,mod_time,path
next unless split.size == 8
@thattommyhall
thattommyhall / clean_tmp.sh
Created June 10, 2011 13:13
Remove files older than 7 days from /tmp
find /tmp -mtime +7 -type f -exec rm -rf {} \;
@thattommyhall
thattommyhall / client.coffee
Created June 22, 2011 10:57
Connecting to ZMQ firehose
tail = (channel, callback) ->
socket = require('zeromq').createSocket('sub')
socket.connect("tcp://IP_ADDRESS:5555")
socket.subscribe(channel)
socket.on 'message', (ch, data) -> callback(JSON.parse(data.toString('utf8')))
tail 'channame', (row) -> console.log(row)
@tobyhede
tobyhede / postsql.sql
Created May 17, 2012 03:08
PostgreSQL as JSON Document Store
-- PostgreSQL 9.2 beta (for the new JSON datatype)
-- You can actually use an earlier version and a TEXT type too
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8
-- Inspired by
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html
-- http://ssql-pgaustin.herokuapp.com/#1
-- JSON Types need to be mapped into corresponding PG types
--
@jgeurts
jgeurts / install-graphite-ubuntu-12.04.sh
Created July 14, 2012 16:36 — forked from tkoeppen/install-graphite-ubuntu-10.04.sh
Install Graphite 0.9.10 on Ubuntu 12.04
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
cd
sudo apt-get update
sudo apt-get upgrade
@gurgeh
gurgeh / mp3.cpp
Created October 11, 2012 11:29
A C++ example of Dive Into Python
//Having to include so many different header files to do basic
//things like open a file, use strings, vectors and tuples, etc,
//is still annoying.
#include <fstream>
#include <vector>
#include <map>
#include <tuple>
#include <string>
//To use C++11 lambdas with Boost lambdas we define this.
@mrchief
mrchief / LICENSE.md
Last active March 23, 2024 12:28
Add "Open with Sublime Text 2" to Windows Explorer Context Menu (including folders)

MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: