Skip to content

Instantly share code, notes, and snippets.

@tternes
tternes / post.js
Last active August 29, 2015 14:10
Pactola Example: node.js
var request = require('request');
var data = JSON.stringify({ message:"Hello, Pactola" });
request.post("http://pactola.io/f1b7db32/notification", {form:data});

Keybase proof

I hereby claim:

  • I am tternes on github.
  • I am tternes (https://keybase.io/tternes) on keybase.
  • I have a public key whose fingerprint is FFF3 75C0 638B 6546 80AD FE08 D003 33C6 1989 42AA

To claim this, I am signing this object:

@tternes
tternes / hello.swift
Created June 6, 2014 04:27
hashbang swift
#!/usr/bin/xcrun swift -i
println("that is awesome")
@tternes
tternes / git-svn-clone.sh
Last active August 29, 2015 14:00
git-svn clone without the full repro
#!/bin/bash
########################################
# Quick and dirty script for cloning an svn branch with git without pulling the entire repo history
#
# Usage: git-svn-clone.sh <URL> <LOCAL_OUTPUT_PATH>
# e.g. git-svn-clone.sh http://myserver.com/svn/branches/feature-1.0 feature-1.0
#
########################################
@tternes
tternes / arc+retain.m
Created April 14, 2014 19:58
ARC + Retain Hack
- (id)swizzled_retain
{
NSLog(@"yes, I know");
return [self swizzled_retain];
}
+ (void)load
{
// swizzle retain
Class c = [self class];
@tternes
tternes / NSHomerString
Created November 25, 2013 18:05
NSHomerString
NSString *homer =
@"\n"
@" __ \n"
@" _ ,___,-'\",-=-. \n"
@" __,-- _ _,-'_)_ (\"\"`'-._\\ `. \n"
@" _,' __ |,' ,-' __) ,- /. | \n"
@" ,'_,--' | -' _)/ `\\ \n"
@" ,',' ,' ,-'_,` : \n"
@" ,' ,-' ,(,-( : \n"
@" ,' ,-' , _ ; \n"
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// andy@andymatuschak.org
// Public domain because I love you. Let me know how you use it.
//
#import <Cocoa/Cocoa.h>
A theory as to the ending of Breaking Bad...
White family: deceased
Hank and Marie: deceased
Kids: deceased
Walt: only one left, cancer cured
It was all for nothing.
#!/bin/sh
# Watch this for a while, then ctrl-c
sudo fs_usage -w -f "filesys"
@tternes
tternes / wwdc2012.rb
Last active December 12, 2015 12:19 — forked from jfahrenkrug/wwdc2013.rb
# in 2012 by Johannes Fahrenkrug, http://springenwerk.com
# See you at WWDC!
require 'rubygems'
require 'open-uri'
class WWDC2012
def self.announced?
begin
title = open('https://developer.apple.com/wwdc/') do |f|