- Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
- rabl - General ruby templating with json, bson, xml, plist and msgpack support
- Thin - Very fast and lightweight Ruby web server
- Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
- SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
- Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
- [factory_girl](h
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
# GET /user/password/edit?reset_password_token=abcdef | |
def edit | |
context = ResettingPassword.new | |
context.add_subscriber(EditDelegator.new(self)) | |
context.find_for_reset(params[:reset_password_token]) | |
end | |
class EditDelegator < ApplicationDelegator | |
def success(user) | |
render :action => :edit, :locals => { :user => user } |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
- 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
- Compass - Open source CSS Authoring Framework.
- Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
- Font Awesome - The iconic font designed for Bootstrap.
- Zurb Foundation - Framework for writing responsive web sites.
- SASS - CSS extension language which allows variables, mixins and rules nesting.
- Skeleton - Boilerplate for responsive, mobile-friendly development.
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 PokemonDecorator < Draper::Decorator | |
def squirtle_scope | |
h.select_tag("shell", colors(current), class: "squirtlicious") | |
end | |
def colors(current) | |
current = 1 | |
h.options_for_select({ | |
"Blue" => 1, | |
"Green" => 2, |
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
#------------------------------------------------------------ | |
# View | |
#------------------------------------------------------------ | |
= form_for(claim...) do |f| | |
= text_field :user_lookup # An existing reference or data to create a new one | |
= text_field :provider_lookup # An existing reference or data to create a new one | |
= text_field :claim_name | |
= text_field :claim_amount | |
= text_area :claim_description |
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
# app/serializers/customer_serializer_spec.rb | |
class CustomerSerializer < ActiveModel::Serializer | |
attributes :customer_number, :email, :username | |
def customer_number | |
object.account_number | |
end | |
def merchant_id |
I have a time range, ex: ["02:15", "04:30"] which shows a session begin and end time.
I need to break that down by the hour. End result would be: 2: 2700 3: 3600 4: 1800
The way I thought about doing this was breaking this down into the following array: ["02:15", "03:00", "04:00", "04:15"] and getting the time difference between the elements.. ie difference between 03:00 and 02:15 which results in 2700s, etc.
Any suggestions on something better? more efficient?
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 Person < ActiveRecord::Base | |
has_one :phone | |
has_many :dogs | |
attr_accessible :name | |
end | |
class Phone < ActiveRecord::Base | |
attr_accessible :phone_number | |
end |
OlderNewer