Skip to content

Instantly share code, notes, and snippets.

View brentertz's full-sized avatar

Brent Ertz brentertz

View GitHub Profile
@brentertz
brentertz / pr-template-bookmarklet.js
Last active August 29, 2015 14:18
PR Template Bookmarklet
javascript:(function() {
var e = document.getElementById('pull_request_body');
if (e) {
if (e.value) {
e.value += '\n\n';
}
e.value += '
#### What does this PR do?\n\n
#### Any background context you want to provide?\n\n
#### Where should the reviewer start?\n\n
@brentertz
brentertz / gist:755691
Created December 26, 2010 22:39
Remove .DS_Store
find . -name *.DS_Store -type f -exec rm {} \;
@brentertz
brentertz / rvm_update_ruby
Created February 11, 2011 23:38
Update RVM and Ruby version
# Update rvm, it moves quickly
rvm update
rvm reload
# List known available ruby versions
rvm list known
rvm install 1.9.2
# Set default ruby version
rvm --default ruby-1.9.2-p136
@brentertz
brentertz / gist:857446
Created March 6, 2011 17:51
Augmented Rails .gitignore
.bundle
db/*.sqlite3
log/*.log
tmp/
.sass-cache/
*.swp
*~
.DS_Store
@brentertz
brentertz / gist:857445
Created March 6, 2011 17:48
Common Global Git Config
git config --global user.name "Your Name"
git config --global user.email youremail@example.com
git config --global alias.co checkout
git config --global core.editor "mate -w"
@brentertz
brentertz / gist:906208
Created April 6, 2011 18:21
Remove .svn directories
find . -name ".svn" -type f -exec rm -rf {} \;
@brentertz
brentertz / gist:911494
Created April 9, 2011 15:52
Simple JS setup
var App = App || {};
App = {
/**
* Default configuration settings.
*
* Examples of how to override defaults
* App.defaults.message = 'Foo bar';
* App.init({'message': 'Bas bat'});
* Note that the original "App.defaults" will always remain available.
@brentertz
brentertz / gist:1043713
Created June 23, 2011 21:45
HAML conditional comments for HTML tag classes
!!! 5
-# paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
/[if lt IE 7] <html lang="en" class="no-js ie6">
/[if IE 7 ] <html lang="en" class="no-js ie7">
/[if IE 8 ] <html lang="en" class="no-js ie8">
/[if IE 9 ] <html lang="en" class="no-js ie9">
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
@brentertz
brentertz / gist:1045048
Created June 24, 2011 15:40
Google CDN jquery with local fallback
-# Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if needed
%script{:src => "//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"}
:javascript
!window.jQuery && document.write('<script src="/javascripts/jquery.min.js"><\/script>')
@brentertz
brentertz / gist:1061741
Created July 2, 2011 22:42
Google analytics async snippet - in haml
-# mathiasbynens.be/notes/async-analytics-snippet
:javascript
var _gaq=[['_setAccount',"#{ENV['GOOGLE_ANALYTICS_ID']}"],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));