Skip to content

Instantly share code, notes, and snippets.

View fanktom's full-sized avatar

Thomas Fankhauser fanktom

View GitHub Profile
@fanktom
fanktom / gist:3772880
Created September 23, 2012 20:03
Scales API Destroy
# Destroy URLs
Scales.destroy "/", "/tracks", "/overview", "/overview.json", "/overview.xml"
@fanktom
fanktom / gist:3772889
Created September 23, 2012 20:05
Scales API Partials
@partial_html = "<div>Just the Navigation</div>"
@partial_xml = "<track><name>Islandary</name><artist>Thomas Fankhauser</artist></track>"
@partial_json = '{ name : "Islandary", artist : "Thomas Fankhauser" }'
# Push a HTML Partial
Scales.push :html => @partial_html, :to => "navigation"
# Push a XML Partial
Scales.push :xml => @partial_xml, :to => "islandary.xml"
@fanktom
fanktom / .bash_profile
Last active December 12, 2015 09:19
Add this to your .bash_profile to automatically add the SSH tunnel necessary for rmate on server connect
# RMate
ssh_mate(){
ssh -R 52698:localhost:52698 $1
}
alias sshmate=ssh_mate
# Usage
sshmate ubuntu@yourserver
@fanktom
fanktom / rmateify
Created February 10, 2013 19:14
Automatically copies the rmate ruby script to a remote server to give him rmate support
#!/usr/bin/env bash
# encoding: UTF-8
TEXT_MATE_APP_NAME="TextMate2"
scp /Applications/$TEXT_MATE_APP_NAME.app/Contents/Frameworks/Preferences.framework/Resources/rmate $1:/usr/bin/rmate
# Usage
# Copy this file to localhost /usr/bin/rmateify
# Run rmateify root@servername once
@fanktom
fanktom / git-init-root-branch
Last active December 31, 2015 20:08
Init a root branch in a current git repository
#!/bin/bash
git symbolic-ref HEAD refs/heads/$1 && rm .git/index && git clean -fdx
@echo "Created new root branch '$1'"

Keybase proof

I hereby claim:

  • I am southdesign on github.
  • I am southdesign (https://keybase.io/southdesign) on keybase.
  • I have a public key whose fingerprint is B581 C015 C0D0 1ACC 27D1 5C39 2938 CD41 F64B D505

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am fanktom on github.
  • I am fanktom (https://keybase.io/fanktom) on keybase.
  • I have a public key whose fingerprint is A7EF 59CF D39A A601 B86F 6E02 ABAB AAB3 A2F5 1FEA

To claim this, I am signing this object:

foo