Skip to content

Instantly share code, notes, and snippets.

View jeffrydegrande's full-sized avatar

Jeffry Degrande jeffrydegrande

View GitHub Profile
Face as diligencias procedidas pelo Departamento de Policia Federal, DEFIRO o
presente pedido de permanencia, vez que restou provado que o (a) estrangeiro (a) esta
casado de fato e de direito com conjuge brasileiro (a), salientando, todavia, que o ato
persistira enquanto for detentor da condicao que lhe deu origem.
class Post < ActiveRecord::Base
attr_accessible :title, :body
acts_as_commentable
# validations
belongs_to :author, :class_name => 'User', :foreign_key => 'user_id'
validates_presence_of :body
scope :with_title, :conditions => [ "title IS NOT NULL" ]
module Superfolio
module TestHelpers
include ActiveSupport::Concern
def login!(user = Factory(:user))
@current_user = user
@current_user.confirm! if @current_user.respond_to?(:confirm!)
sign_in @current_user
controller.stub!(:current_user).and_return(@current_user) if defined?(controller)
@current_user
end
$(".grid input:checked").each(function(e){
var isPending = $(this).parents("tr:first").hasClass("pending");
var value = currencyToFloat( tr.children(".value").html() );
if (isDebit(value)) {
adjustDebit(value);
} else if (isCredit(value)) {
adjustCredit(value);
}
});
---- index.haml
%html
%head
%body.sessions-new
blah blah
----- _login.sass (2)
body.sessions-new
args = Rails.application.routes.routes.first.defaults.dup.merge({:host => 'localhost'})
Rails.application.routes.url_for(args)
=> "http://localhost/users/sign_in"
source 'http://rubygems.org'
gem 'rails', '3.0.0.rc'
gem "rails3-generators"
gem "mongoid", ">= 2.0.0.beta.14"
gem "bson_ext", "1.0.4"
gem "haml"
gem "devise", ">= 1.1.1"
gem "devise_invitable", :path => File.join(File.dirname(__FILE__), '/vendor/gems/devise_invitable')
gem 'responders'
style.css: *.sass sass/*.sass
sass -t expanded style.sass > style.css
mockup.html: mockup.haml
haml mockup.haml mockup.html
clean:
rm -fr *.html
rm -fr *.css
$ git diff
diff --git a/lib/sprockets_on_heroku.rb b/lib/sprockets_on_heroku.rb
index 781b9cf..77b3153 100644
--- a/lib/sprockets_on_heroku.rb
+++ b/lib/sprockets_on_heroku.rb
@@ -44,7 +44,9 @@ class SprocketsOnHeroku
def initialize_sprockets
secretary.concatenation.save_to(javascript_location_on_heroku)
minify
- self.class.original_sprockets_location = '/sprockets.js'

GitHub Javascript Strategy

Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.

File naming

  • All jquery plugins should be prefixed with jquery, such as jquery.facebox
  • All github-specific jquery plugins should be prefixed with jquery.github. Like jquery.github.repo_list.js
  • All page-specific files (that only run on ONE page) should be prefixed with page. page.billing.js