Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Fankhauser fanktom

View GitHub Profile
View keybase.md

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:

View keybase.md

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:

@fanktom
fanktom / git-init-root-branch
Last active Dec 31, 2015
Init a root branch in a current git repository
View git-init-root-branch
#!/bin/bash
git symbolic-ref HEAD refs/heads/$1 && rm .git/index && git clean -fdx
@echo "Created new root branch '$1'"
@fanktom
fanktom / rmateify
Created Feb 10, 2013
Automatically copies the rmate ruby script to a remote server to give him rmate support
View rmateify
#!/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 / .bash_profile
Last active Dec 12, 2015
Add this to your .bash_profile to automatically add the SSH tunnel necessary for rmate on server connect
View .bash_profile
# RMate
ssh_mate(){
ssh -R 52698:localhost:52698 $1
}
alias sshmate=ssh_mate
# Usage
sshmate ubuntu@yourserver
@fanktom
fanktom / gist:3772889
Created Sep 23, 2012
Scales API Partials
View gist:3772889
@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 / gist:3772880
Created Sep 23, 2012
Scales API Destroy
View gist:3772880
# Destroy URLs
Scales.destroy "/", "/tracks", "/overview", "/overview.json", "/overview.xml"
@fanktom
fanktom / gist:3772857
Created Sep 23, 2012
Scales API Modify
View gist:3772857
@html = '
<html>
<body>
<div><h1>Tracks</h1></div>
<div id="tracks">
<p id="track1">Track 1</p>
</div>
</body>
</html>'
@fanktom
fanktom / gist:3772800
Created Sep 23, 2012
Scales API Update
View gist:3772800
# HTML Update URLs
Scales.update "/", "/tracks", "/overview", :format => :html
# XML Update URLs
Scales.update "/tracks.xml", "/overview.xml", :format => :xml
# JSON Update URLs
Scales.update "/tracks.json", "/overview.json", :format => :json
You can’t perform that action at this time.