This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------ snip ------ | |
# Includes many of our custom types and providers, as well as global | |
# config. Required. | |
github "boxen", "3.4.2" | |
# Core modules for a basic development environment. You can replace | |
# some/most of these if you want, but it's not recommended. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addNested: function(model) { | |
var view = new View.Nested({ model: model }); | |
this.$("#nested-view").html(view.render().el); | |
// Then I can safely init stuff like chosen.js | |
view.$("select").chosen(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Question < ActiveRecord::Base | |
# UGLY | |
def self.starts_with(*strings) | |
# Big loop to build something like this... | |
where("wording LIKE ? OR wording LIKE ? OR wording LIKE ?", 'blah%', 'blaah%', 'blaaah%') | |
end | |
# PURDY | |
def self.starts_with(*strings) | |
strings = strings.map { |s| s+'%' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"color_scheme": "Packages/Color Scheme - Default/Cobalt.tmTheme", | |
"font_size": 13.0, | |
"ensure_newline_at_eof_on_save": true, | |
"tab_size": 2, | |
"draw_white_space": "all", | |
"translate_tabs_to_spaces": true, | |
"trim_trailing_white_space_on_save": true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tempfile.open("attachment", "#{Rails.root}/tmp") do |f| | |
f.binmode # my attachment is binary | |
f.write(model.attachment.file.read) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.extend(Backbone.Model.prototype, { | |
// By default, rails expects model params to be wrapped in a nested params hash | |
// https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/metal/params_wrapper.rb | |
_paramsWrapper : function() { | |
return this.paramsWrapper; | |
} | |
}); | |
// Alias Backbone.sync method to inject Rails specific |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install ruby-debug19 -- --with-ruby-include=/Users/peter/.rvm/src/ruby-1.9.2-head/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Author | |
include Mongoid::Document | |
field :name, :type => String | |
embeds_many :posts | |
end | |
class Post | |
include Mongoid::Document | |
field :title, :type => String | |
embedded_in :author |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Attempt 1 (require comes first) | |
--------------------------------- | |
### lib/html5-boilerplate.rb ### | |
require File.join(File.dirname(__FILE__), 'app', 'helpers', 'html5_boilerplate_helper') | |
Compass::Frameworks.register("html5-boilerplate", :path => "#{File.dirname(__FILE__)}/..") | |
Stack Trace: | |
/Users/peter/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': /Users/peter/.rvm/gems/ruby-1.9.2-head@html5/gems/html5-boilerplate-0.1.6/lib/html5-boilerplate.rb:1: syntax error, unexpected tCONSTANT, expecting $end (SyntaxError) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo aptitude update | |
sudo aptitude dist-upgrade | |
sudo aptitude install openssh-server | |
sudo aptitude install build-essential binutils-doc | |
sudo aptitude install autoconf flex bison | |
sudo aptitude install vim |
NewerOlder