Skip to content

Instantly share code, notes, and snippets.

@wadey
wadey / examples.java
Created June 6, 2012 16:53
IntelliJ Templates
// log4j
private static final Logger log = LogManager.getLogger($CLASS_NAME$.class);
@wadey
wadey / webhook.md
Created August 28, 2011 23:13
Botriot WebHooks

Botriot WebHooks

Format

Both the POST data and the expected response data are application/json

POST Request

If a user posts one of the following in the channel:

@wadey
wadey / iterm2.zsh
Last active March 10, 2024 00:32
Change iTerm2 tab color when using SSH
# Usage:
# source iterm2.zsh
# iTerm2 tab color commands
# https://iterm2.com/documentation-escape-codes.html
if [[ -n "$ITERM_SESSION_ID" ]]; then
tab-color() {
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"
Emoji: {
'sunny': '2600',
'zap': '26a1',
'leaves': '1f343',
'lipstick': '1f483',
'cop': '1f46c',
'wheelchair': '267f',
'fish': '1f413',
'hammer': '1f52c',
'moneybag': '1f4b0',
$ npm install thrift --loglevel info
npm info it worked if it ends with ok
npm info using npm@1.0.6
npm info using node@v0.4.7
npm info addNamed [ 'thrift', '' ]
npm info into /Users/wade/sandbox/ttest thrift@0.6.0-1
npm info installOne thrift@0.6.0-1
npm info unbuild /Users/wade/sandbox/ttest/node_modules/thrift
npm info preinstall thrift@0.6.0-1
npm info build /Users/wade/sandbox/ttest/node_modules/thrift
Emoji: {
'sunny': '2600',
'zap': '26a1',
'leaves': '1f343',
'lipstick': '1f483',
'cop': '1f46c',
'wheelchair': '267f',
'fish': '1f413',
'hammer': '1f52c',
'moneybag': '1f4b0',
# works
# func({a: 1, b: 2})
func
a: 1
b: 2
# doesn't work
# func(1, 2)
func
1
@wadey
wadey / index.html
Created January 13, 2011 18:35 — forked from mager/index.html
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
@import url("http://github.com/simplegeo/polymaps/raw/v2.4.0/examples/example.css");
html, body {height: 100%;}
svg {display: block;}
.layer circle {fill: #f00;stroke: #000;stroke-width: 2px;}
</style>
var thrift = require('thrift');
var sys = require('sys');
var scheduler_thrift = require('./gen-nodejs/JobExchange.js'),
scheduler_ttypes = require('./gen-nodejs/scheduler_types.js');
var conn = thrift.createConnection('localhost', 8081),
client = thrift.createClient(scheduler_thrift, conn);
conn.on('error', function(err) {
// This example attempts to time out before the connection is established
var net = require('net');
var start = Date.now();
var stream = net.createConnection(9999, 'google.com');
stream.setTimeout(1000);