Skip to content

Instantly share code, notes, and snippets.

View coderberry's full-sized avatar

Eric Berry coderberry

View GitHub Profile
@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');
});
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
@coderberry
coderberry / chrome-cheat-sheet.md
Last active March 10, 2023 13:56
Chrome Canary Console Cheat Sheet
<!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 / 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
@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
var EventEmitter = require('events').EventEmitter;
var mergeInto = require('react/lib/mergeInto');
module.exports = createStore;
function createStore(initialState) {
var events = new EventEmitter();
var state = initialState || {};
return {
@eliotsykes
eliotsykes / rails_new_help_output.md
Last active March 31, 2024 17:09
"rails new" options explained

Run rails new --help to view all of the options you can pass to rails new:

$ bin/rails new --help
Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]                                      # Path to the Ruby binary of your choice
                                                         # Default: /Users/eliot/.rbenv/versions/2.2.0/bin/ruby
@dwickstrom
dwickstrom / nightmare.sh
Last active December 22, 2018 01:27
NightmareJS - install Electron on Ubuntu 14.04
apt-get -y update
apt-get -y upgrade
apt-get -y --force-yes install make unzip g++ libssl-dev git xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps clang libdbus-1-dev libgtk2.0-dev libnotify-dev libgnome-keyring-dev libgconf2-dev libasound2-dev libcap-dev libcups2-dev libxtst-dev libxss1 libnss3-dev gcc-multilib g++-multilib
npm -f init
npm i -S nightmare
xvfb-run nodejs index.js
@hadees
hadees / arel_helpers.rb
Created March 5, 2016 05:41
Arel Helpers
module ArelHelpers
extend self
def self.included(base)
base.extend self
end
def asterisk(arel_table_or_model)
arel_table, columns = case arel_table_or_model
when Arel::Table