Skip to content

Instantly share code, notes, and snippets.

View drewdeponte's full-sized avatar

Drew De Ponte drewdeponte

View GitHub Profile
@drewdeponte
drewdeponte / gist:737771
Created December 12, 2010 01:22
Get the Probability of Precipitation from Weather Service REST API
#!/usr/bin/env ruby
require 'rubygems'
require 'rest_client'
require 'rexml/document'
def getHourProbPrecip(zipcodes_array)
zipcodes_str = zipcodes_array.join('+')
results = {}
@drewdeponte
drewdeponte / test_adding_past_view_scrolls
Created December 23, 2010 04:28
A jQuery example that allows the user to test if adding elements past the view height causes jumping to the new element.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Test jQuery Adding Causing Scrolling?</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<style type="text/css" media="screen">
#container {
margin-top: 5px;
border: solid 1px;
padding: 4px;
# Git aliases
alias gs='git status'
alias gd='git diff | mate'
alias gb='git branch'
# Bundle aliases
alias be='bundle exec'
alias bec='be cucumber -f pretty'
alias bes='be rspec --format doc'
export EDITOR="/usr/bin/mate -w"
# Git aliases
alias gs='git status'
alias gd='git diff | mate'
alias gb='git branch'
# Bundle aliases
alias be='bundle exec'
alias bec='be cucumber -f pretty'
alias bes='be rspec --color --drb'
@drewdeponte
drewdeponte / gist:922764
Created April 16, 2011 01:45
Trick to get mysql2 to work with RVM and Bundler
install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib /Users/adeponte/.rvm/gems/ruby-1.9.2-p0/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
@drewdeponte
drewdeponte / gist:977348
Created May 17, 2011 20:44
TextMate -> File -> Preferences -> Advanced -> Folder References -> Folder Pattern
!(vendor/bundle|vendor/images|log|cache)|.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$
@drewdeponte
drewdeponte / gist:1006819
Created June 3, 2011 18:06
Grep for finding console.log statements in code base.
grep -r --exclude=*.{log,min.js} "[^/]console\.log" *
include LinkedinHelpers
include FacebookHelpers
include Socializer
def nav_link(name, path, path_only = false)
host = path_only ? '' : RppWebApp::CONFIG['hostname']
if request.url.include?(path) || session[:nav_link_path] == path
link_to(name, host + path, { :class => "selected" })
else
link_to(name, host + path)
Last login: Thu Sep 1 16:23:00 on ttys003
[~]$ sudo dscl . create /Users/jenkins
Password:
[~]$ sudo dscl . create /Users/jenkins PrimaryGroupID 1
[~]$ sudo dscl . create /Users/jenkins UniqueID 300
[~]$ sudo dscl . create /Users/jenkins UserShell /bin/bash
[~]$ sudo dscl . passwd /Users/jenkins 3d4b66
[~]$ sudo dscl . create /Users/jenkins home /Users/Shared/Jenkins/Home/
[~]$ sudo launchctl unload -w /Library/LaunchAgents/org.jenkins-ci.plist
launchctl: Couldn't stat("/Library/LaunchAgents/org.jenkins-ci.plist"): No such file or directory
@drewdeponte
drewdeponte / snippet.txt
Created December 15, 2011 00:01
trace of rvm --create foo@bar in .rvmrc run by capistrano
** [out :: db02] rvm 1.10.0 by Wayne E. Seguin ([email protected]) [https://rvm.beginrescueend.com/]
** [out :: db02]
** [out :: db02] +++ [[ -n '' ]]
** [out :: db02] +++ export 'PS4=+ ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
** [out :: db02] +++ PS4='+ ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
** [out :: db02] +++ /scripts/cli : __rvm_parse_args() 743 > [[ -z rvmrc ]]
** [out :: db02] +++ /scripts/cli : __rvm_parse_args() 745 > [[ 0 -eq 1 ]]
** [out :: db02] +++ /scripts/cli : __rvm_parse_args() 745 > [[ -n '' ]]
** [out :: db02] +++ /scripts/cli : __rvm_parse_args() 36 > [[ -n '' ]]
** [out :: db02] +++ /scripts/cli : __rvm_parse_args() 749 > [[ 0 -gt 0 ]]