Skip to content

Instantly share code, notes, and snippets.

View romac's full-sized avatar
🔮
λ

Romain Ruetschi romac

🔮
λ
View GitHub Profile
@romac
romac / gist:670042
Created November 9, 2010 23:32
A recursive TypoScript getText()
// This will get you the title of the page identified by the uid supplied in GET/POST variable "page".
temp.foo = TEXT
temp.foo {
dataWrap = db:pages:{GP:page}:title
wrap3 = {|}
insertData = 1
}
http://twitter.com/#!/ppk
http://twitter.com/#!/jeresig
http://twitter.com/#!/jquery
http://twitter.com/#!/julien51
http://twitter.com/#!/iA
http://twitter.com/#!/jbaubort
http://twitter.com/#!/simurai
http://twitter.com/#!/WebKitBits
http://twitter.com/#!/timberners_lee
http://twitter.com/#!/ambroisemaupate
@romac
romac / goodnight.h
Created November 24, 2010 23:42
I wish you all a good night, thanks to EOS-SKL ;)
#define __RR_GN_MAP__()__EOS_SKL_LP01__(__EOS_SKL_WRITE__),\
__EOS_SKL_LP32__(__EOS_SKL_READ__),__EOS_SKL_LP02__(__EOS_SKL_READ__),\
__EOS_SKL_LP01__(0107), __EOS_SKL_LP01__(0117),__EOS_SKL_LP01__(0117),__EOS_SKL_LP01__(0104),\
__EOS_SKL_LP01__(__EOS_SKL_READ__),\
__EOS_SKL_LP01__(0116),__EOS_SKL_LP01__(0111),__EOS_SKL_LP01__(0107),\
__EOS_SKL_LP01__(0110),__EOS_SKL_LP01__(0124),\
__EOS_SKL_LP32__(__EOS_SKL_READ__),__EOS_SKL_LP02__(__EOS_SKL_READ__),\
__EOS_SKL_LP01__(__EOS_SKL_WRITE__)
#define __R_HEADER(eax,ebx,ecx,edx,esp,esb,esi,edi)\
@romac
romac / Surprise.h
Created November 26, 2010 23:42
A litte suprise for @macmade
#define __UNICORN_SKL__(eax,ebx,ecx,edx,esp) \
const ecx##edx##eax##ebx __header_skl_cp__[esp]={ \
__EOS_SKL_SJMP__(),__UNICORN_SKL_MMAP(),__EOS_SKL_SJMP__() \
};
#define __UNICORN_SKL_MMAP() \
__EOS_SKL_SBRK__,\
__EOS_SKL_LP01__(__EOS_SKL_SBRK__), \
__EOS_SKL_LP01__(__EOS_SKL_READ__), \
@romac
romac / strip_replies.js
Created November 29, 2010 21:09
A little bookmarklet which removes tweets starting with a @ from the Twitter timeline.
// Thanks to @defunkt, you can find a draggable version of this bookmarklet here:
// http://bookmarklets.heroku.com/bookmarklets/1796
// If you prefer to create it yourself here is the one-line version:
// javascript:(%20function(%20$%20){$(%20%27.tweet-text%27%20).each(function(){var%20$this%20=%20$(%20this%20);if(%20$.trim(%20$this.html()%20)[%200%20]%20===%20%27@%27%20){$this.closest(%20%27.stream-item%27%20).fadeOut();}});}%20)(%20jQuery%20);
// And if you really want to start from scratch:
( function( $ )
{
@romac
romac / strip_replies_advanced.js
Created November 29, 2010 22:20
A bookmarklet that will let you choose to hide or not the @replies on a Twitter timeline.
// You will find the draggable version there: http://bookmarklets.heroku.com/bookmarklets/1798
(
function( $ )
{
var removedTweets = [],
$button = null,
interval = null;
insertButton();
@romac
romac / re_load_bookmarklet.js
Created December 14, 2010 01:02
A simple bookmarklet to (re)load a script on a web page.
( function( $, id, src )
{
var $body = $( document.body ),
$script = $( '<script src="' + src + '?_UNIQUE_" id="' + id + '"></script>' ),
$prev = $( '#' + id );
if( $prev.length > 0 )
{
$prev.remove();
}
@romac
romac / sc_sync.sh
Created March 7, 2011 10:36
Sync SoundCloud.app's playlists over Dropbox.
# Enable SoundCloud.app to sync its playlists over DropBox.
# You'll have to launch it on every computers you want to sync together.
# 1. Download the script.
# 2. Edit the SC_DROPBOX_PATH variable if your DropBox folder is not located inside your home folder.
# 3. Lauch Terminal.app.
# 4. Browse to the directory where the script is located: `cd /path/to/folder`
# 5. Make the script executable: `chmod +x sc_sync.sh`
# 6. Launch the script: `./sc_sync.sh`
@romac
romac / Makefile
Created May 4, 2011 14:01
Convert Markdown files to a single Word document.
MARKDOWN=Scripts/Markdown.pl
DOC_FORMAT=doc
MD_OUTPUT=All.md
HTML_OUTPUT=Documentation.html
DOC_OUTPUT=Documentation.$(DOC_FORMAT)
.PHONY : all clean convert concat md2html html2doc
all: concat convert
@romac
romac / gist_ps1.sh
Created May 4, 2011 20:16
Git branch in PS1
parse_git_branch()
{
if [[ -d ./.git ]]; then
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'
fi
}
PS1='\[\033[01;37m\]\w\[\033[00;35m\]$(parse_git_branch)\[\033[00m\] \$ '