Skip to content

Instantly share code, notes, and snippets.

View BigBlueHat's full-sized avatar
🎩
building Web things

BigBlueHat BigBlueHat

🎩
building Web things
View GitHub Profile
@tilgovi
tilgovi / export.py
Created August 25, 2012 07:57
Open Annotation export from okfn/annotator-store
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import json
import jsonld
import pprint
import rdflib
import rdflib_jsonld
@melanke
melanke / MultiGetSet.js
Created June 19, 2012 20:53
MultiGetSet.JS - Quickly generate getters and setters for multiple attributes
var MultiGetSet = function(opt){
var getType = function(o) {
return ({}).toString.call(o).match(/\s([a-zA-Z]+)/)[1].toLowerCase()
};
if(!opt.public || !opt.private)
return opt.public;
if(opt.handler && opt.handler.init)
@davidjrice
davidjrice / README.md
Created June 6, 2012 17:00
Vagrantfile for an Ubuntu lucid 32 or 64 bit VM with couchbase 2.0.0.dp4.1

Install Virtualbox

wget http://download.virtualbox.org/virtualbox/4.1.16/VirtualBox-4.1.16-78094-OSX.dmg
open VirtualBox-4.1.16-78094-OSX.dmg
# double click .pkg to install

Install vagrant

gem install vagrant --no-ri --no-rdoc
@davidjrice
davidjrice / Vagrantfile
Created June 6, 2012 12:46
Ubunutu Lucid 64bit with Couchbase Server 2.0.0.dp4
# -*- mode: ruby -*-
# vi: set ft=ruby :
MIRROR = "http://packages.couchbase.com/releases/2.0.0-developer-preview-4"
VERSION = "couchbase-server-community_x86_64_2.0.0-dev-preview-4.deb"
# Vagrant: http://vagrantup.com
Vagrant::Config.run do |config|
# Use 64bit Ubuntu Lucid 10.04
config.vm.box = "lucid64"
@rnewson
rnewson / gist:2387973
Created April 14, 2012 21:31
CouchDB Future Feature List - Round 2
A list of features that we want to see in CouchDB. Needs to be voted on so that it can become a priority queue.
User Facing Features
====================
1. Conflicts are the rule, not the exception
All previous versions of CouchDB hide conflicts by default (selecting
an arbitrary but consistent winning revision). Expert users can find
and resolve conflicts.
@wickman
wickman / README.md
Created April 12, 2012 22:55
Python development in Pants (tutorial)

Python development using Pants

brian wickman - @wickman

[TOC]

Why use Pants for Python development?

Pants makes the manipulation and distribution of hermetically sealed Python environments

@troy
troy / send_remote_syslog.php
Last active March 30, 2025 16:15
Send UDP remote syslog message from PHP (RFC 3164)
# replace PAPERTRAIL_HOSTNAME and PAPERTRAIL_PORT
# see http://help.papertrailapp.com/ for additional PHP syslog options
function send_remote_syslog($message, $component = "web", $program = "next_big_thing") {
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
foreach(explode("\n", $message) as $line) {
$syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line;
socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, PAPERTRAIL_HOSTNAME, PAPERTRAIL_PORT);
}
socket_close($sock);
<?php
if($currentCall->initialText) {
_log("*** User sent: " . $currentCall->initialText . " ***");
$result = ask("", array("choices" => "[ANY]"));
}
else {
call($numberToCall, array("timeout" => 60, "channel" => "TEXT", "network" => "SMS"));
$result = ask("Respond with a digit, any digit.", array("choices" => "[1 DIGIT]"));
}
#!/usr/bin/env coffee
Couchstore = require './couchstore'
db = new Couchstore 'cstest.couch'
create = (cb) ->
docset = ((db.newdoc 'doc' + x, {testkey: 'testval' + x}) for x in [1..20])
db.save_multi docset, (err) ->
cb?()
dump = (fin) ->
@melanke
melanke / README.md
Created January 17, 2012 17:32 — forked from eligrey/object-watch.js
watch the changes of some object or attribute