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:1006819
Created June 3, 2011 18:06
Grep for finding console.log statements in code base.
grep -r --exclude=*.{log,min.js} "[^/]console\.log" *
@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: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
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'
# 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'
@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;
@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 / gist:737766
Created December 12, 2010 01:19
google maps javascript test
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
@drewdeponte
drewdeponte / memcached.plist
Created October 28, 2010 19:44
~/Library/LaunchAgents/memcached.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>memcached</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/memcached</string>
<string>-l</string>
#!/usr/bin/env ruby
require 'date'
d = Date.today
puts d.cweek()