Skip to content

Instantly share code, notes, and snippets.

View jwelshiv's full-sized avatar
🏠
Working from home

James Welsh jwelshiv

🏠
Working from home
View GitHub Profile
require 'autotest/growl'
Autotest.add_hook(:initialize) {|at|
at.add_exception %r{^\.git} # ignore Version Control System
at.add_exception %r{^./tmp} # ignore temp files, lest autotest will run again, and again...
# at.clear_mappings # take out the default (test/test*rb)
at.add_mapping(%r{^lib/.*\.rb$}) {|f, _|
Dir['spec/**/*.rb']
}
nil
@jwelshiv
jwelshiv / hack.sh
Created April 1, 2012 00:07 — forked from igrigorik/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jwelshiv
jwelshiv / _media-queries.scss
Created May 29, 2012 11:59 — forked from anthonyshort/_media-queries.scss
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@jwelshiv
jwelshiv / 10.8.3.setup
Last active December 15, 2015 00:39
Clean OSX Mountain Lion install (10.8.3) and ruby/dev environment.
# Obviously not all required, these are just fairly common tools.
# Install Xcode from App Store
# open XCode > Preferences > Downloads > Install the command line tools
# -- OR --
# Download and install just the command line tools from https://developer.apple.com/downloads
# Homebrew for dependencies
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew update
@jwelshiv
jwelshiv / gist:5240230
Created March 25, 2013 20:07
Tail heroku logs and make sound when match found
#!/usr/bin/ruby
# brew install portaudio
# gem install bloopsaphone
require 'bloops'
# the bloops o' phone
bloops = Bloops.new
bloops.tempo = 150
@jwelshiv
jwelshiv / gist:8666141
Created January 28, 2014 11:33
Mavericks Setup
Install Xcode
xcode-select --install
# Homebrew
# http://brew.sh/
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
# Fix any issues found
brew doctor
@jwelshiv
jwelshiv / Dockerfile
Last active August 29, 2015 14:01
docker osx
# DOCKER-VERSION 0.3.4
FROM ubuntu:latest
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get -y install python-software-properties python g++ make software-properties-common
RUN add-apt-repository ppa:chris-lea/node.js && apt-get update
RUN apt-get -y install git nodejs
# Bundle app source
ADD ./src /src
@jwelshiv
jwelshiv / gist:47810700b596ee72763b
Last active August 29, 2015 14:20
clean node setup
# Install command line tools
xcode-select --install
# Homebrew for osx dependencies
# http://brew.sh/
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Fix any issues found
brew doctor
function isElementVisible (el, withinEl) {
var withinRect = withinEl ?
withinEl.getBoundingClientRect() :
{ top: 0, left: 0, right: window.innerWidth, bottom: window.innerHeight };
var rect = el.getBoundingClientRect();
return (
rect.top >= withinRect.top &&
rect.left >= withinRect.left &&