Skip to content

Instantly share code, notes, and snippets.

View neilberget's full-sized avatar

Neil Berget neilberget

View GitHub Profile
@neilberget
neilberget / setup-osx.sh
Created November 13, 2014 20:28
A script for setting up a new os x computer for development
#!/bin/sh
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Update homebrew recipes
@neilberget
neilberget / .aliases
Last active August 29, 2015 14:09
Selecta Aliases
# Kill a process
alias zap="ps aux | tail -n+2 | selecta | tr -s ' ' | cut -d ' ' -f 2 | xargs kill"
# Kill a process with -9
alias zap9="ps aux | tail -n+2 | selecta | tr -s ' ' | cut -d ' ' -f 2 | xargs kill -9"
# cd into an arbitrarily deep subdirectory. Don't try in directories with too many subdirectories (e.g. $HOME)
alias sd='cd $(find * -type d | selecta)'
# Create a ~/.sshto file with a list of hosts (or user@hosts) you commonly ssh to.
### Keybase proof
I hereby claim:
* I am neilberget on github.
* I am neilberget (https://keybase.io/neilberget) on keybase.
* I have a public key whose fingerprint is 1CF6 E8D3 CF1F 5251 B4B7 120A 25F9 209F 3ECA 8C7E
To claim this, I am signing this object:
@neilberget
neilberget / Vagrantfile
Last active December 21, 2015 23:29
Set up a vagrant box on OS X with docker ready to go. Based off of great blog post at: http://dyli.sh/2013/08/23/OSX-Vagrant-Docker-Sinatra.html
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "raring"
config.vm.box_url = "http://cloud-images.ubuntu.com/raring/current/raring-server-cloudimg-vagrant-amd64-disk1.box"
@neilberget
neilberget / form-validator.coffee
Created August 23, 2012 00:01
Form Validator for jQuery
class FormValidator
constructor: (@form, opts) ->
{@validations, @human_names} = opts
$(@form).submit (e) =>
@errors = []
for key, value of @validations
if typeof(value) == "function"
funcs = [value]
@neilberget
neilberget / markup.html
Created August 18, 2012 19:07
3d flip card effect with CSS
<div class="container">
<div class="flipcard">
<figure class="front">
Front of Card
</figure>
<figure class="back">
Back of Card
</figure>
</div>
</div>
@neilberget
neilberget / Rakefile
Created May 10, 2012 00:16
[EXPERIMENTAL] A ruby method that looks for all accessibility labels in all the xib files in the resources directory of a RubyMotion project, create auto-incrementing tags for those elements, and create a ruby file mapping constants named after the labels
task :labels do
require './xib_labels'
XibLabels.process
end