Skip to content

Instantly share code, notes, and snippets.


Jamu Kakar jkakar

  • Vancouver, Canada
  • Twitter @jkakar
View GitHub Profile
View bash_profile
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
# append to the history file, don't overwrite it
shopt -s histappend
View .psqlrc
-- Don't rollback the entire transaction if you typo a SQL query when
-- in interactive mode.
\set ON_ERROR_ROLLBACK interactive
-- Show query timing information.
-- Include transaction information in the prompt.
\set PROMPT1 '%[%033[33;1m%]%x%[%033[0m%]%[%033[1m%]%/%[%033[0m%]%R%# '
View make-requests.go
package main
import (
View gist:c80ebb182818cff92000
$ rebar3 compile
===> Verifying dependencies...
===> Fetching edown ({git,"git://",{tag,"0.4"}})
===> Compiling edown
===> Compiling /Users/jkakar/src/ failed
/Users/jkakar/src/ field packages undefined in record doclet_gen
/Users/jkakar/src/ field filemap undefined in record doclet_gen
View DEBUG=1 rebar3 edown
===> Evaluating config script "/Users/jkakar/src/"
===> Evaluating config script "/Users/jkakar/src/"
===> sh info:
cwd: "/Users/jkakar/src/"
cmd: git rev-parse -q HEAD
===> opts: [{cd,"/Users/jkakar/src/"}]
===> Port Cmd: git rev-parse -q HEAD
Port Opts: [{cd,"/Users/jkakar/src/"},
# bash/zsh git prompt support
# Copyright (C) 2006,2007 Shawn O. Pearce <>
# Distributed under the GNU General Public License, version 2.0.
# This script allows you to see repository status in your prompt.
# To enable:
# 1) Copy this file to somewhere (e.g. ~/
View binary_join.erl
%% Join binary values using the specified separator.
binary_join([], _) -> <<"">>;
binary_join([H|[]], _) -> H;
binary_join(L, Sep) when is_list(Sep) ->
binary_join(L, list_to_binary(Sep));
binary_join([H|T], Sep) ->
binary_join(T, H, Sep).
binary_join([], Acc, _) ->
View gist:f6c18cfcc4bc6d5903b5
%% API
make_config() ->
View gist:6c441b938f800aed702d
default_creds() ->
#{access_key_id => undefined,
secret_access_key => undefined,
session_token => undefined}.
default_config() ->
Config = #{endpoint => undefined,
region => default_region()},
maps:merge(aws_creds:default_creds(), Config).