Skip to content

Instantly share code, notes, and snippets.

View epogue's full-sized avatar
Caffeinated

Elliott Pogue epogue

Caffeinated
View GitHub Profile
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/prototype.js"
# add basic layout to start
file 'app/views/layouts/application.html.erb', <<HTML
@epogue
epogue / Rails MongoMapper Template.rb
Created May 21, 2010 14:51 — forked from banker/Rails MongoMapper Template.rb
A Rails Template for MongoMapper geared towards Heroku's MongoHQ integration
# mongo_template.rb
# fork of Ben Scofield's Rails MongoMapper Template (http://gist.github.com/181842)
#
# To use:
# rails project_name -m http://gist.github.com/408924.txt
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
Bundler version 1.0.0
Ruby version 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
RVM version 1.0.1 with environment:
ruby-1.9.2-p0:
system:
uname: "Darwin Goliath.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386"
# This is an incomplete implementation.
module NestedAttributes
extend ActiveSupport::Concern
module ClassMethods
def accepts_nested_attributes_for(*attr_names)
options = { :allow_destroy => false }
options.update(attr_names.extract_options!)
options.assert_valid_keys(:allow_destroy, :reject_if)
@epogue
epogue / app-template.rb
Created March 22, 2012 17:55
Rails 3 app template
require 'open-uri'
run "rm public/index.html"
run "rm .gitignore"
rake "db:migrate"
file ".gitignore", <<-CODE
#{URI.parse("https://raw.github.com/github/gitignore/master/Rails.gitignore").read}
*.sublime-workspace
CODE
@epogue
epogue / st-louis-table.html
Created March 5, 2014 22:25
St. Louis table
<notextile>
<table class="table table-bordered" cellpadding="0" cellspacing="0" style="max-width:600px;">
<tr class="headers">
<th></th>
<th>Halogen</th>
<th>LED</th>
</tr>
<tr>
<td><b>Bulb Life</b></td>
<td>5,000 hours</td>
<div id="ms-embedded-request-form" data-height="400"></div>
<script type="text/javascript">
(function(s,o,g,r){
g = s.createElement(o);
r = s.getElementsByTagName(o)[0];
g.type = 'text/javascript';
g.async = 1;
g.src = 'http://assets.mosquitosquad.com/embed-form/embed.js';
r.parentNode.insertBefore(g, r);
})(document, 'script');
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
/* Extend the Underscore object with the following methods */
// Rate limit ensures a function is never called more than every [rate]ms
// Unlike underscore's _.throttle function, function calls are queued so that
// requests are never lost and simply deferred until some other time
//
// Parameters
// * func - function to rate limit
// * rate - minimum time to wait between function calls
// * async - if async is true, we won't wait (rate) for the function to complete before queueing the next request
@epogue
epogue / .projections.json
Created November 18, 2015 13:40 — forked from jeremywrowe/.projections.json
ember-cli VIM projections
{
"app/adapters/*.js": {
"command": "adapter",
"template": [
"import ApplicationAdapter from './application';",
"",
"export default ApplicationAdapter.extend({",
"",
"});"
],