Skip to content

Instantly share code, notes, and snippets.

# Set up ssh-agent
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
# echo "Initializing new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
# echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
@ubernil
ubernil / .vimrc
Created June 23, 2015 16:23
.vimrc
set t_Co=256
set nocompatible
set fileformat=unix
set encoding=utf-8
" Change leader to a comma because the backslash is too far away
" That means all \x commands turn into ,x
" The mapleader has to be set before vundle starts loading all
" the plugins.
let mapleader=","
@ubernil
ubernil / cidr_calc.ex
Created July 28, 2015 14:26
CidrCalc
defmodule CidrCalc do
def addresses_for(ip) do
{:ok, range_start, range_end}= String.to_char_list(ip) |> :orber_acl.range(:inet)
[net_a, net_b, net_c, net_d] = Enum.zip(convert(range_start), convert(range_end))
|> Enum.map(fn {s, e} -> s..e end)
for a <- net_a, b <- net_b, c <- net_c, d <- net_d, do: {a, b, c, d}
end
@ubernil
ubernil / .gitconfig
Last active December 17, 2015 07:49 — forked from nogizhopaboroda/gist:c2c730b22f92f5ec9727
Git aliases
[alias]
lg = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
lg2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit
co = checkout
ci = commit
# Usage:
# source iterm2.zsh
# iTerm2 window/tab color commands
# Requires iTerm2 >= Build 1.0.0.20110804
# http://code.google.com/p/iterm2/wiki/ProprietaryEscapeCodes
tab-color() {
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"
echo -ne "\033]6;1;bg;blue;brightness;$3\a"
mkdir -p ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/CoffeeScript
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/CoffeeScript
curl -O https://raw.github.com/jashkenas/coffee-script-tmbundle/master/Syntaxes/CoffeeScript.tmLanguage
curl -O https://raw.github.com/jashkenas/coffee-script-tmbundle/master/Preferences/CoffeeScript.tmPreferences
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@ubernil
ubernil / README.md
Created February 12, 2016 17:54 — forked from joakimk/README.md
CircleCI elixir build example

This runs a build for a small elixir (phoenix) project in about 40 seconds by caching as much of the compiled files as possible.

We've been using this for months in multiple projects without any issues. Please ping be if there is any issues with this script and I'll update it.

It should be generic enough to work on any elixir app using mix.

If you have a elixir_buildpack.config, then enable that section in the build script to keep versions in sync!

\set QUIET 1
-- formatting
\x auto
\set VERBOSITY verbose
\set ON_ERROR_ROLLBACK interactive
-- show execution times
\timing
-- limit paging
--\pset pager off