Skip to content

Instantly share code, notes, and snippets.

View nicerobot's full-sized avatar
๐Ÿค–
โ˜ฏ๏ธ โ˜ฎ๏ธ ๐Ÿถ ๐Ÿพ ๐Ÿ‘พ ๐ŸŽฎ ๐ŸŽผ ๐ŸŽถ ๐Ÿ•บ ๐ŸŽง ๐ŸŒป ๐ŸŒฑ ๐Ÿž ๐ŸŒŠ ๐ŸŒ” ๐ŸŒŽ

nicerobot

๐Ÿค–
โ˜ฏ๏ธ โ˜ฎ๏ธ ๐Ÿถ ๐Ÿพ ๐Ÿ‘พ ๐ŸŽฎ ๐ŸŽผ ๐ŸŽถ ๐Ÿ•บ ๐ŸŽง ๐ŸŒป ๐ŸŒฑ ๐Ÿž ๐ŸŒŠ ๐ŸŒ” ๐ŸŒŽ
View GitHub Profile
@nicerobot
nicerobot / watch.sh
Created December 20, 2012 17:06
simple directory watching for new files.
#!/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
@nicerobot
nicerobot / README.md
Last active December 10, 2015 03:28
Scala Cheat Sheet :Gish
@nicerobot
nicerobot / README.md
Last active July 22, 2020 00:51
HTTPS Basic Authentication in Go :Gish
@nicerobot
nicerobot / README.md
Last active December 10, 2015 09:28
Reset Open With menu

Run:

curl -ks https://gist.github.com/nicerobot/4414102/raw/reset-open_with.sh | bash -il

See Apple Discussions Thread 4291523.

@nicerobot
nicerobot / columnar.sh
Last active December 10, 2015 13:18
Convert line-oriented output into multi-column output.
#!/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"}'
@nicerobot
nicerobot / .vimrc
Created January 5, 2013 04:19
.vim
" 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
@nicerobot
nicerobot / README.md
Last active December 11, 2015 09:48
An example of writing `take` in Java.
@nicerobot
nicerobot / join.sh
Last active December 11, 2015 15:49
| join
#!/bin/bash
join() {
perl -p -e "s/\n/${1:-\t}/g"
}
([ ! -t 0 ] || join)
@nicerobot
nicerobot / wrap.sh
Created January 24, 2013 16:24
| wrap
#!/bin/bash
wrap() {
awk -v prefix="${1}" -v suffix="${2}" '{print prefix $0 suffix}'
}
([ "${1}" -a ! -t 0 ] && wrap ${1} ${2})
@nicerobot
nicerobot / README.md
Last active December 12, 2015 05:59
Mac OS X Dropbox-like Github repository.

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.