Skip to content

Instantly share code, notes, and snippets.

View coderberry's full-sized avatar

Eric Berry coderberry

View GitHub Profile
@ryankshaw
ryankshaw / gist:82aef3a8fba10ea4a744
Last active August 29, 2015 14:06
proper code structure when defining a React component
MyComponent = React.createClass
# give your component a DisplayName that is equal to it's file name.
# it is helpful so you dont just see <<anonymous>> when react prints
# warnings in the console or <Undefined> in the react inspector.
displayName: 'MyComponent'
# propTypes should be the second thing, after your DisplayName
propTypes:
# then put the rest of the react specific properties, in this order
@coderberry
coderberry / db.rake
Created July 10, 2014 14:46
rake db:migrate:reset_all
namespace :db do
namespace :migrate do
desc "runs db:drop db:create db:migrate for both development and test environments"
task :reset_all do
system('bundle exec rake db:migrate:reset')
system('bundle exec rake db:migrate:reset RAILS_ENV=test')
end
end
end
<!doctype html>
<meta charset="utf-8">
<link rel="stylesheet" href="bower_components/qunit/qunit/qunit.css">
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/handlebars/handlebars.js"></script>
<script src="bower_components/ember/ember.js"></script>
@coderberry
coderberry / chrome-cheat-sheet.md
Last active March 10, 2023 13:56
Chrome Canary Console Cheat Sheet
web: bundle exec unicorn -c vendor/plugins/zachp-local/unicorn.rb
guard: bundle exec guard start --no-interactions
job: bundle exec script/delayed_job run > /dev/null
mail: bundle exec mailtrap run
@virusman
virusman / example.js
Created September 25, 2012 10:31
Twitter Bootstrap Tabs + History.js - made as jQuery plugin
$(document).ready(function() {
//init tab history with default tab 'table'
$(window).tabHistory('table');
});