Skip to content

Instantly share code, notes, and snippets.

@tamasd
tamasd / pocket2readability.md
Created October 11, 2012 07:57
pocket to readability

Open http://getpocket.com/a/queue/list/ Paste into the command line:

$.post("/a/x/get.php", {offset: 0, count: 1000, state: "queue", favorite: "null", sort: "oldest", search: "", tag: "", view: "list", formCheck: window.formCheck}, function (r) {var d = JSON.parse(r); var urls = []; for (var i in d.list) { urls.push(d.list[i].given_url); } alert(JSON.stringify(urls)); })

Copy the text from the popup.

Go to readability.com, log in Paste the code into the command line and replace the PASTE_HERE text with the one you have copied.

@juhasz
juhasz / gist:2358317
Created April 11, 2012 09:54
VIM: split and align SQL queries - a quick way
s/, /,\r / | '{,.s/ FROM/\rFROM/ | '{,'}s/ JOIN/\r JOIN/ | s/ WHERE/\rWHERE/ | s/ AND/\r AND/ | '{,'}s/ ORDER/\rORDER/ | '{,'}s/ LIMIT/\rLIMIT/
nnoremap <space> :| inoremap jk <esc>|se softtabstop=2|se tabstop=2|se expandtab|se shiftwidth=2|se autoindent|se smartindent
@wolever
wolever / tabtreatment.vim
Created January 22, 2012 20:58
Vim functions to change tab treatment
" Usage:
" - copy+paste into ~/.vimrc or ~/.vim/plugin/tabtreatment.vim
" - Call with ':call HardTabs(...)' or ':call SoftTabs(...)'
" HardTabs([width=8]): Sets up the current buffers so that:
" - '\t' is 'widith' wide
" - '<tab>' inserts a '\t'
" - '>>' shifts one tab
fun! HardTabs(...)
let width = (a:0 > 0? a:1 : 8)
@eethann
eethann / drupalcs_fix.sed
Created December 15, 2011 16:41
Simple sed script to resolve common Drupal.org coding standards violations.
#!/usr/bin/env sed -f
# whitespace at end of lines
s/\s\+$//
# fix comma followed by non-space character
# don't be picky, this is correct even for text!
/function/!s/\(,\)\(\S\)/\1 \2/g
# fix comments may not appear after statements
@tomekwojcik
tomekwojcik / whatthecommit.vim
Created March 24, 2011 11:47
A VIM "plugin" that'll automagically download a random whatthecommit message and insert it into the buffer.
command! Commit :r!msg="`curl http://whatthecommit.com/index.txt 2>/dev/null`"; echo "$msg"; echo "via http://whatthecommit.com/`echo $msg | md5`"
@eculver
eculver / tmuxrc
Created December 14, 2010 00:55
tmuxrc
# command prefix (like screen)
set -g prefix C-a
bind C-a send-prefix
# basic settings
set-window-option -g mode-keys vi # vi key
set-option -g status-keys vi
set-window-option -g utf8 on # utf8 support
set-window-option -g mode-mouse off # disable mouse