Skip to content

Instantly share code, notes, and snippets.

@agam
agam / boot-cljs.sh
Created July 27, 2016 23:04
Minimal cljs generation with boot
$ boot cljs -s -- target
@agam
agam / brew.sh
Created July 18, 2016 06:42
Fix brew permissions
$ sudo chown -R $(whoami) /usr/local
$ brew update # Just to confirm everything worked
@agam
agam / tux-color.md
Last active June 28, 2016 17:17
Fix Emacs color scheme inside Tmux

Tmux sets TERM to screen Emacs doesn't use all available colors with this environment variable

E.g. in fish shell, fix this by set -gx TERM xterm-256color

@agam
agam / virtualenv-fish.sh
Last active July 26, 2016 22:15
Using virtualenv on OS X from within the Fish shell
$ pip3 install virtualfish
$ emacs -nw ~/.config/fish/config.fish
# ... add `eval (python3 -m virtualfish)`
# In case $EDITOR is not set
$ set -g EDITOR 'emacs -nw'
$ funced fish_prompt
# Add the following lines:
if set -q VIRTUAL_ENV
@agam
agam / postgres-brew.md
Last active June 8, 2016 04:18
Postgres on OSX

$ brew info postgresql

... confirm version etc.

$ brew install postgresql

...

To have launchd start postgresql now and restart at login: brew services start postgresql

@agam
agam / postgresql-jdbc.clj
Created May 18, 2016 08:52
Basic postgresql interaction through Clojure REPL
;; Assuming project.clj contains the following:
;; [org.clojure/java.jdbc "0.6.1"]
;; [postgresql "9.3-1102.jdbc41"]
(require '[clojure.java.jdbc :as sql])
(def db-spec "postgresql://localhost:5432/thousand_words")
(sql/db-do-commands db-spec
(sql/create-table-ddl :locations
@agam
agam / hugo.sh
Created May 6, 2016 04:27
Some frequently run hugo commands
# A personal crib sheet for Hugo
## See what the current version looks like
$ hugo server -t angels-ladder -D -w -v
## Copy generated site over to github repo
$ hugo -d ../Github/agam.github.io/ --theme=angels-ladder
## Create a new post
$ hugo new post/my-new-post.md
@agam
agam / freebsd-port.sh
Created May 1, 2016 03:29
Install FreeBSD port "quietly"
$ sudo make install clean BATCH=yes
@agam
agam / freebsd.sh
Created April 30, 2016 04:05
Fix port build error on FreeBSD 10.2
$ cd /usr/ports/ports-mgmt/pkg
$ sudo make deinstall reinstall
@agam
agam / iTerm.md
Created April 29, 2016 03:12
Fix Alt-b and Alt-f behavior in iTerm
  • Open Preferences, select Profiles, and then the Keys tab.
  • Change the radio button selection for the left (and/or right) Option key to be +Esc instead of Normal