Skip to content

Instantly share code, notes, and snippets.

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'https://www.youtube.com/watch?v=jzkUUSWiM_4']
[debug] Encodings: locale UTF-8, fs utf-8, out None, pref UTF-8
[debug] youtube-dl version 2014.11.16
[debug] Git HEAD: ff0f8a1
[debug] Python version 2.7.8 - Darwin-14.0.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.2, ffprobe 2.2
[debug] Proxy map: {'http': 'http://localhost:22001/', 'https': 'http://localhost:22001/', 'no': 'localhost,127.0.0.1,.map.dev'}
[youtube] Confirming age
#!/usr/bin/env bash
size=1024 # MB
mount_point=$HOME/tmp
name=$(basename "$mount_point")
usage() {
echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \
"(default: mount)" >&2
}
@Roman2K
Roman2K / imac5k
Last active August 29, 2015 14:09
pry -eexit startup time
real 0m0.160s
user 0m0.123s
sys 0m0.035s
@Roman2K
Roman2K / yosemite_free_up_diskspace.sh
Last active August 29, 2015 14:08
Delete system apps to free up precious disk space in OS X Yosemite - http://forums.macrumors.com/showthread.php?p=20328653
#!/usr/bin/env bash
files=(
"/Applications/iMovie.app"
"$HOME/Library/iMovie"
/Applications/Photos.app
/Users/roman/Pictures/Photos\ Library.photoslibrary
"/Users/roman/Library/Preferences/com.apple.Photos.LSSharedFileList.plist"
@Roman2K
Roman2K / inst.sh
Created October 23, 2014 14:51
Raw test script for a clean non-root install of wkhtmltopdf
curl -L http://iweb.dl.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_osx-carbon-i386.pkg > wk.pkg \
&& pkgutil --expand wk.pkg wk \
&& mkdir unwk \
&& (cd unwk && gunzip < ../wk/Payload | cpio -id) \
&& mkdir dest \
&& (cd dest && tar x) < unwk/usr/local/share/wkhtmltox-installer/app.tar.xz
! Hybrid Terminal Colours. Uses the palette from Tomorrow-Night:
! https://github.com/chriskempson/tomorrow-theme/blob/master/vim/colors/Tomorrow-Night.vim
! vim: ft=xdefaults
*background: #1D1F21
*foreground: #C5C8C6
! black
*color0: #282A2E
*color8: #373B41
! red
var url = 'http://www.unicreditbank.si/tecajna_lista/?t=1&id_menu=&language=ENG';
var rate = UrlFetchApp.fetch(url).getContentText().replace(/\s+/g, '').match(/>USD<\/td.*?>1,.*?>(1,\d+)/)[1];
#!/usr/bin/env bash
exec coffee -cs < "$1" > /dev/null
@Roman2K
Roman2K / guard-kill
Created January 31, 2014 14:06
For when Guard doesn't behave after a Ctrl-C (won't exit or worse, leaves session-leader processes in the wild).
#!/usr/bin/env bash
guard_pids() {
ps ax | egrep ' guard (master|worker)' | while read pid _; do
echo $pid
done
}
kill_guard() {
pids=$(guard_pids)