Skip to content

Instantly share code, notes, and snippets.

View booo's full-sized avatar

Philipp Borgers booo

View GitHub Profile
config defaults
option syn_flood '1'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
option drop_invalid '0'
config zone
option name 'lan'
import Data.List
data STree a = Empty | Node (STree a) a (STree a)
deriving (Eq, Ord, Show)
bft :: [STree a] -> [[a]]
bft = unfoldr f
where f x = case x of
[] -> Nothing
#!/bin/bash
# This script is intended to be used with the install action
# of puppet-cloudpack
set -u
set -e
function fedora_repo() {
cat >/etc/yum.repos.d/puppet.repo <<'EOFYUMREPO'
[puppetlabs]
class Batch
constructor: (@keyspace) ->
@statements = [] #list of statements aka insert delete update
toCQL: ->
"BEGIN BATCH
#{(stmt.toCQL() for stmt in @statements).join "\n"}
APPLY BATCH"
pg = require "./"
utils = require "./lib/utils"
utils.prepareValue = (val) ->
if val instanceof Date then return JSON.stringify val
if typeof val is 'undefined' then return null
if val instanceof Array then return "{#{val.join ", "}}"
val is null ? null : val.toString()
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
stroke: #fff;
stroke-width: 1.5px;
}
.link {
class Batch
constructor: (@keyspace) ->
@statements = [] #list of statements aka insert delete update
toCQL: ->
"BEGIN BATCH
#{(stmt.toCQL() for stmt in @statements).join "\n"}
APPLY BATCH"
pg = (require "./").native
client = new pg.Client()
#client.on "error", (error) -> console.log error # this one works
client.connect((error)-> console.log error) # this one does not work
make test-native connectionString=pg://postgres:5432@localhost:5432/postgres
gyp info it worked if it ends with ok
gyp info using node-gyp@0.5.6
gyp info using node@0.8.1
gyp info spawn python
gyp info spawn args [ '/home/borgers/.node-gyp/0.8.1/tools/gyp_addon',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-I/home/borgers/projects/node-postgres/build/config.gypi',
gyp info spawn args '-f',
gyp info spawn args 'make' ]
@booo
booo / httpforker.coffee
Created June 4, 2012 01:19
http forker
# fork http traffic
# e.g. proxy is your production system
# and proxy2 your testing setup
http = require "http"
PRODUCTION_HOST = "localhost"
PRODUCTION_PORT = 8081
TESTING_HOST = "localhost"
TESTING_PORT = 8082