Skip to content

Instantly share code, notes, and snippets.

@stammy
stammy / gist:2494287
Created April 25, 2012 23:10
asset precompilation error on requirejs-rails
$ bundle exec rake assets:precompile
/Users/Stammy/.rvm/rubies/ruby-1.9.3-p0-perf/bin/ruby /Users/Stammy/.rvm/gems/ruby-1.9.3-p0-perf/bin/rake requirejs:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: ENOENT, no such file or directory '/Users/Stammy/code/picplum/app/assets/javascripts/app/strobeo.js'
at Object.openSync (fs.js:230:18)
at Object.readFileSync (fs.js:120:15)
at Object.readFile (/Users/Stammy/.rvm/gems/ruby-1.9.3-p0-perf/gems/requirejs-rails-0.7.3/bin/r.js:2707:27)
require.config({
paths: {
jquery: 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min',
jqueryui: 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min',
json2: 'libs/json2',
underscore: "libs/underscore_132",
backbone: "libs/backbone_92",
order: 'order',
// uploader
fileupload: 'libs/jquery.fileupload',
modules:
- name: "main"
baseUrl: "app/assets/javascripts/"
paths:
jquery: "empty:"
jqueryui: "empty:"
backbone: "libs/backbone_92"
underscore: "libs/underscore_132"
fileupload: 'libs/jquery.fileupload'
fileupload_ui: 'libs/jquery.fileupload-ui'
@stammy
stammy / hack.sh
Created April 1, 2012 09:55 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@stammy
stammy / gist:1610222
Created January 14, 2012 04:05
some startups on tumblr (that should probably move off tumblr)
http://tumblr.everlane.com/
http://blog.hipmunk.com/
http://blog.shoplrapp.com/
http://blog.mailgun.net/
http://blog.grooveshark.com/
http://blog.path.com/
http://blog.instagram.com/
http://blog.oink.com/
http://blog.shelby.tv/
http://blog.roamz.com/
@stammy
stammy / application_controller.rb
Created July 5, 2011 18:45 — forked from aliang/application_controller.rb
Force SSL on Devise routes only, then redirect back
class ApplicationController < ActionController::Base
# Tell Devise to redirect after sign_in
def after_sign_in_path_for(resource_or_scope)
some_url(:protocol => 'http')
end
# Tell Devise to redirect after sign_out
def after_sign_out_path_for(resource_or_scope)
some_url(:protocol => 'http')
end
@stammy
stammy / gist:979877
Created May 19, 2011 00:02
bitcoin on ec2 cg1.4xlarge GPU Cluster instance
[ec2-user@ip-XXX-XXX-XXX-XXX 64]$ ./bitcoind getinfo
{
"version" : 32100,
"balance" : 0.00000000,
"blocks" : 125008,
"connections" : 74,
"proxy" : "",
"generate" : true,
"genproclimit" : -1,
"difficulty" : 244139.48158254,
@stammy
stammy / gist:961862
Created May 9, 2011 00:43
rails 3 error_messages_for deprecation replacement
<% if @user.errors.any? %>
<div id="errorExplanation">
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this record from being saved:</h2>
<ul>
<% @user.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
@stammy
stammy / application_helper.rb
Created April 26, 2011 08:42
rails 3 pretty page titles. no more instance vars all up in your controllers
module ApplicationHelper
# pretty page titles
# yield_for(:title, 'default text goes here') in layout
# content_for(:title, 'some text') in view
def yield_for(content_sym, default)
output = content_for(content_sym)
output = default if output.blank?
output
end
end
@stammy
stammy / application_controller.rb
Created April 23, 2011 09:36 — forked from aliang/application_controller.rb
Force SSL on Devise routes only, then redirect back
class ApplicationController < ActionController::Base
# Tell Devise to redirect after sign_in
def after_sign_in_path_for(resource_or_scope)
some_url(:protocol => 'http')
end
# Tell Devise to redirect after sign_out
def after_sign_out_path_for(resource_or_scope)
some_url(:protocol => 'http')
end