Skip to content

Instantly share code, notes, and snippets.

View will's full-sized avatar
🆒
ه҈ͣفͤ҈ͥ҉ͦ҈ͧ҉ͨ҈ͩ҉ͪ҈ͫ҉ͬ҈ͭ҉ͮ҈ͯ҉ͨ҈ͬ҉ͧ҈ͣ҉ͨ҈ͧ҉ͯ҈ͮ҉ͭ҈ͤ҉ͦ҈ͥ҉ͧ҈ͩ҉ͭ҈ͨ҉ͣ҈ͪ҉ͧ҈ͭ҉ͩ҈ͤ҉ͮ҈ͯ҉ͬ҈

Will Leinweber will

🆒
ه҈ͣفͤ҈ͥ҉ͦ҈ͧ҉ͨ҈ͩ҉ͪ҈ͫ҉ͬ҈ͭ҉ͮ҈ͯ҉ͨ҈ͬ҉ͧ҈ͣ҉ͨ҈ͧ҉ͯ҈ͮ҉ͭ҈ͤ҉ͦ҈ͥ҉ͧ҈ͩ҉ͭ҈ͨ҉ͣ҈ͪ҉ͧ҈ͭ҉ͩ҈ͤ҉ͮ҈ͯ҉ͬ҈
View GitHub Profile
@will
will / postgres
Last active August 29, 2015 13:57
Running a devl build of postgres
git clone https://github.com/postgres/postgres.git && cd postgres
./configure --prefix=/tmp/postgres --with-openssl --with-ossp-uuid --with-libs=/usr/local/opt/readline/lib/ --with-includes=/usr/local/opt/readline/include/
# skip the readline parts if you dont have readline installed but it makes `psql` better
make -sj8
make install
/tmp/postgres/bin/initdb /tmp/postgres/data
@iain
iain / gc.patch
Created July 10, 2011 09:41
Two patches I use for Ruby 1.9.2-p180
diff --git a/gc.c b/gc.c
--- a/gc.c
+++ b/gc.c
@@ -77,6 +77,41 @@ void *alloca ();
#ifndef GC_MALLOC_LIMIT
#define GC_MALLOC_LIMIT 8000000
#endif
+#define HEAP_MIN_SLOTS 10000
+#define FREE_MIN 4096
+
@fdr
fdr / experiment.sql
Created August 17, 2011 04:17
plv8 experiments and microbenchmarks
BEGIN;
-- plv8: http://code.google.com/p/plv8js/
CREATE OR REPLACE LANGUAGE plv8;
-- Create a function that grabs a passed key and coerces to bigint.
CREATE OR REPLACE FUNCTION plv8_project_key(key text, json_raw text)
RETURNS bigint AS $$
// This is javascript!
var o = JSON.parse(json_raw);
return o[key];
@will
will / caveatPatchor.js
Created October 3, 2011 03:17
propane something awful emoticons
// ~/Library/Application Support/Propane/unsupported/caveatPatchor.js
var mapping = {};
var loadEmotes = function(response) {
response.forEach(function(a){a.emoticons.forEach(function(b){mapping[b.code] = b.image})});
window.chat.speaker.filters.unshift(
function(m){
var match;
if(match=m.match(/^:(.*):$/)){
return mapping[match[0]];
#!/bin/sh
NAME=$1
DATADIR=${2:-.pg}
[ $NAME == "" ] && { echo usage: pg_dev NAME [DATADIR]; exit 1; }
echo Initializing database in $DATADIR
initdb $DATADIR
@[Link(ldflags: "-lpq -I`pg_config --includedir` -L`pg_config --libdir`")]
lib LibPQ
fun connect = PQconnectdb(conninfo : UInt8*) : Void*
fun exec = PQexec(conn : Void*, query : UInt8*) : Void*
fun getvalue = PQgetvalue(res : Void*, row : Int32, column : Int32) : UInt8*
end
conn = LibPQ.connect("postgres:///")
res = LibPQ.exec(conn, "select 'Hello it is ' || now()")
String.new(LibPQ.getvalue(res, 0, 0)) #=> "Hello it is 2015-07-15 16:30:44.396092-07"
@datanoise
datanoise / crystal-tags.cr
Last active March 5, 2021 03:24
ctags for crystal language
require "compiler/crystal/**"
require "option_parser"
include Crystal
class ToCtagsVisitor < Visitor
@filename : String
@lines : Array(String)
@io : IO
@opts : Generator
@robinsloan
robinsloan / unfave.rb
Last active June 5, 2022 21:32
Unfave script, because why not??
#!/usr/bin/env ruby
require "rubygems"
require "twitter"
require "json"
require "faraday"
# things you must configure
TWITTER_USER = "your_username"
# get these from dev.twitter.com
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.