JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ~/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]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
NAME=$1 | |
DATADIR=${2:-.pg} | |
[ $NAME == "" ] && { echo usage: pg_dev NAME [DATADIR]; exit 1; } | |
echo Initializing database in $DATADIR | |
initdb $DATADIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@[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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
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.
OlderNewer