Skip to content

Instantly share code, notes, and snippets.

Emoji: {
'sunny': '2600',
'zap': '26a1',
'leaves': '1f343',
'lipstick': '1f483',
'cop': '1f46c',
'wheelchair': '267f',
'fish': '1f413',
'hammer': '1f52c',
'moneybag': '1f4b0',
@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"
@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 / examples.java
Created June 6, 2012 16:53
IntelliJ Templates
// log4j
private static final Logger log = LogManager.getLogger($CLASS_NAME$.class);
@wadey
wadey / bootstrap.py
Created March 7, 2013 20:53
findi -> postgres
from record_location import Base, engine
msg = 'Warning! This will drop your database. Please confirm:'
shall = True if raw_input("%s (y/N) " % msg).lower() == 'y' else False
if not shall:
print "Cancelled database drop and creation..."
else:
print "Dropping and creating the database..."
Base.metadata.drop_all(engine)
@wadey
wadey / Makefile
Created December 5, 2013 19:14
Makefile for generating Go coverage reports for Jenkins (for projects containing multiple packages)
GO=$(firstword $(subst :, ,$(GOPATH)))
GOCOV=$(GO)/bin/gocov
GOCOVXML=$(GO)/bin/gocov-xml
# List of pkgs for the project
PKGS=$(shell go list ./...)
# Coverage output: coverage/$PKG/coverage.out
COVPKGS=$(addsuffix /coverage.out,$(addprefix coverage/,$(PKGS)))

Keybase proof

I hereby claim:

  • I am wadey on github.
  • I am wadey (https://keybase.io/wadey) on keybase.
  • I have a public key whose fingerprint is 6B06 FA83 D482 D52A E59E C5F8 0B42 F7A3 E3D9 D6D7

To claim this, I am signing this object:

import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
@wadey
wadey / betagoal.py
Last active August 29, 2015 14:02
World Cup Slack Bot (with delay for no spoilers)
import time
import json
from twitter import TwitterStream, OAuth
import requests
import settings
twitter_stream = TwitterStream(
auth=OAuth(
@wadey
wadey / godeps.zsh
Created August 25, 2015 18:15
godeps
#!/bin/zsh
typeset -A DONE
_dep() {
go list -f "{{if not .Standard}}{{printf \"\t%q -> %q;\n\" \"$1\" .ImportPath}}{{end}}" "$2"
}
_graph() {
if [ -z ${DONE[$1]} ]