Skip to content

Instantly share code, notes, and snippets.

ifightcrime / .bashrc
Created Mar 19, 2016 — forked from vsouza/.bashrc
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
View .bashrc
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
ifightcrime /
Created Feb 14, 2016 — forked from solusipse/
Postfix + Dovecot + Postgresql + Postfixadmin + Roundcube

Postfix Installer

Following script may be used for configuring complete and secure email server on fresh install of Debian 7. It will probably work on other distributions using apt-get. After minor changes you'll be able to use it on other Linux distros.


  1. Run script.
  2. Configure postgres to allow connections.
  3. Configure postfix admin. Remember to set these:
ifightcrime /
Last active Jan 21, 2016
Read, transform, and write a csv file
ifightcrime /
Last active Dec 11, 2015
Install VirtualBox Guest Additions (Linux)

Devices > Install Guest Additions CD Image

mount /dev/sr0 /media/cdrom && cd /media/cdrom
ifightcrime / accept_nested_attributes.js
Last active Nov 3, 2015
FormBuilder addition for models that accept nested attributes.
View accept_nested_attributes.js
function addNestedRow(e) {
var html = $('#my-attribute-link-template').html();
var $attr_row = $(html.replace(/new_MyAttribute/g, new Date().getTime()));
ifightcrime / random_password.rb
Created Sep 8, 2015
Safari like random passwords in ruby
View random_password.rb
BASE = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
def random_string(length = 3) { BASE[rand(BASE.length)] }.join
puts { random_string }.join('-')
ifightcrime / hash_dig.rb
Created Jul 14, 2015
"Dig" through hash using dot notation
View hash_dig.rb
class Hash
def dig(dotted_path)
parts = dotted_path.split '.', 2
first_part = parts[0]
match = self[first_part] || self[first_part.to_sym]
if !parts[1] || match.nil?
return match
return match.dig(parts[1])
ifightcrime / hashquiz.rb
Last active Aug 29, 2015 — forked from potatosalad/hashquiz.rb
Ruby quiz for convert hash "dot paths" into actual hash hierarchy.
View hashquiz.rb
#require 'rubygems'
require 'pp'
#require 'ap' # Awesome Print
class Object
# expects [ [ symbol, *args ], ... ]
def recursive_send(*args)
args.inject(self) { |obj, m| obj.send(m.shift, *m) }
# Note: ensure credentials file is at /opt/splunkclouduf.spl first
# download latest Splunk forwarder
# untar
tar -zxvf splunkforwarder-6.2.1-245427-Linux-x86_64.tgz
View wercker-nodejs-default.yml
box: wercker/nodejs
# Build definition
# The steps that will be executed on build
# A step that executes `npm install` command
- npm-install
# A step that executes `npm test` command
- npm-test
You can’t perform that action at this time.