This scalacheat was swiped from scala-lang.org and reformatted to be suitable for a PDF or PNG or maybe even Dash.
๐ค
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
watch() { | |
touch .newer | |
while :; do | |
find . -type f -newer .newer \ | |
| grep -v .newer \ | |
| while read f; do | |
process_watch ${f} | |
touch .newer | |
done | processall_watches |
Based on rosettacode.org's HTTPS/Authenticated#Go.
Run:
curl -ks https://gist.github.com/raw/4375261/run.sh | sh
The client will respond with the message from the server:
Goodbye, World!
Run:
curl -ks https://gist.github.com/nicerobot/4414102/raw/reset-open_with.sh | bash -il
See Apple Discussions Thread 4291523.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
columns=${1:-4} | |
# Tab separated: | |
${TAB:-false} && awk -v columns=${columns} -v RS='\n' '{ORS=(++i%columns?"\t":"\n");print}END{print "\n"}' | |
# Fixed width: | |
${TAB:-false} || awk -v width=${width} -v columns=${columns} -v RS='\n' '{printf "%-*s%s",width,$0,(++i%columns?"":"\n")}END{print "\n"}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" https://github.com/mnazim/dotfiles/blob/master/vim/vimrc | |
syntax on | |
colorscheme zellner | |
set t_ti= t_te= " don't clear the screen on exit | |
set ignorecase | |
set smartcase | |
set incsearch | |
set showbreak=> | |
set wrap linebreak textwidth=0 | |
set autowrite |
This is my example code response to Why Functional Programming in Java is Dangerous which i (somewhat harshly) commented about.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
join() { | |
perl -p -e "s/\n/${1:-\t}/g" | |
} | |
([ ! -t 0 ] || join) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wrap() { | |
awk -v prefix="${1}" -v suffix="${2}" '{print prefix $0 suffix}' | |
} | |
([ "${1}" -a ! -t 0 ] && wrap ${1} ${2}) |
Create a project:
curl -sk https://gist.github.com/nicerobot/4726285/raw/project | bash -s [project-name]
By using a LaunchAgent and a few simple scripts, this somewhat emulates something like Dropbox but on a Github repository.
Currently, the automated means of adding projects to ~/.dropgit
just uses a bare git repository so requires a push but there's absolutely no reason that directories can't be manually added to ~/.dropgit
and folders to org.nicerobot.dropgit.plist
.
e.g.