-
The -j option of the application generator accepts an arbitrary string. If passed "foo", the gem "foo-rails" is added to the Gemfile, and the application JavaScript manifest requires "foo" and "foo_ujs". As of this writing "prototype-rails" and "jquery-rails" exist and provide those files via the asset pipeline. Default is "jquery". [fxn]
-
jQuery is no longer vendored, it is provided from now on by the jquery-rails gem. [fxn]
-
Prototype and Scriptaculous are no longer vendored, they are provided from now on by the prototype-rails gem. [fxn]
-
The scaffold controller will now produce SCSS file if Sass is available [Prem Sichanugrist]
This file contains hidden or 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 User < ActiveRecord::Base | |
has_many :columns | |
def as_json(options={}) | |
attributes.slice(:id, :email, :uuid).merge(:columns => columns) | |
end | |
end | |
class Column < ActiveRecord::Base | |
belongs_to :user | |
has_many :boxes |
This file contains hidden or 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
// This is a bit non-DRY | |
// XXX Check how to properly refactor. | |
var AxAutocompletes = function () { | |
// Javascript permite nesting. Es mejor que nada quede definido en la parte externa. | |
var split = function (val) { return val.split( /,\s*/ ); } | |
var extractLast = function (term) { return split(term).pop(); } | |
// lift del $.bind |
This file contains hidden or 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
# No es un poco más rápido sin el Date object? | |
# Crear un objeto cada vez es un poco feo. | |
# Sobre todo cuando es una función que se llama como 3mil veces | |
# Además, new Date(milisecs) es una mierda. | |
toHumanTime: -> | |
# date = new Date(@milliSeconds) | |
hours = Math.floor(@milliSeconds / (1000 * 60 * 60)) % 24 | |
mins = Math.floor(@milliSeconds / (1000 * 60)) % 60 # date.getMinutes() | |
secs = Math.floor(@milliSeconds / (1000)) % 60 # date.getSeconds() |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
module FormsHelper | |
def self.included(base) | |
ActionView::Base.default_form_builder = TwitterFormBuilder | |
end | |
class TwitterFormBuilder < ActionView::Helpers::FormBuilder | |
def legend(text) | |
content_tag :fieldset, content_tag(:legend, text) |
This file contains hidden or 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
javascript:void((function(){var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://local.weheartit.com:3000/bookmarklet.js');e.setAttribute('id','whi-js-dev');document.body.appendChild(e)})()); |
This file contains hidden or 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 Foo | |
def threaded_upload | |
t1 = Time.now | |
threads = [] | |
100.times do |i| | |
threads << Thread.new(i) do |i| | |
uploader = Attachment::Uploader.new | |
uploader.upload("0" * 20 * 1024, "threaded/#{i}") | |
end |
This file contains hidden or 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
100 = :continue | |
101 = :switching_protocols | |
102 = :processing | |
200 = :ok | |
201 = :created | |
202 = :accepted | |
203 = :non_authoritative_information | |
204 = :no_content | |
205 = :reset_content | |
206 = :partial_content |
This file contains hidden or 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
map <c-n> scrollDown | |
map <c-p> scrollUp | |
map <c-b> scrollLeft | |
map <c-f> scrollFullPageDown | |
map <c-b> scrollFullPageUp | |
map <c-v> scrollFullPageDown | |
map <a-v> scrollFullPageUp | |
map <c-w> copyCurrentUrl | |
map <a-w> copyCurrentUrl | |
map <c-k> copyCurrentUrl |