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
#=require haml | |
#=require backbone | |
class PageView extends Backbone.View | |
tag: "div" | |
class: "page" | |
classes: -> | |
[] |
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
GitHub.TreeSlider = function () { | |
if (window.history && window.history.pushState) { | |
function a() { | |
if (e.sliding) { | |
e.sliding = false; | |
$(".frame-right").hide(); | |
$(".frame-loading:visible").removeClass("frame-loading") | |
} | |
} | |
if (!($("#slider").length == 0 || !GitHub.shouldSlide)) if (!navigator.userAgent.match(/(iPod|iPhone|iPad)/)) { |
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
# Update, upgrade and install development tools: | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install build-essential | |
apt-get -y install git-core | |
# Install rbenv | |
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
# Add rbenv to the path: |
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
# user.json.rabl_spec.rb | |
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', '..')) | |
$: << File.join(APP_ROOT, 'spec/support') # for my spec helpers | |
$: << File.join(APP_ROOT, 'config/initializers') # for rabl_init.rb | |
require 'my_spec_mocks' | |
require 'rabl' | |
require 'rabl_init' | |
# We need to fool rabl into thinking we are running rails. | |
# All rabl wants is the root path to help in finding templates. |
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
<br> | |
var stickywidth = 200; // width of sticky note (can't be less than 200)<br> | |
var stickyheight = 200; // height of sticky note (can't be less than 200)<br> | |
var max_notes = 500; // maximum number of notes one can store<br> | |
var allowed_tags = '<br /><br><ol></ol><ul></ul><li></li><strong></strong><i></i>';<br> | |
var html5sticky = {};<br> | |
var note_index = 0;<br> | |
// add a note <br> | |
//we need to modify this to work as repin a note <br. | |
html5sticky.addNote = function(){<br> |
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
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
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
# config/initializers/active_model_serializers.rb | |
Mongoid::Document.send(:include, ActiveModel::SerializerSupport) | |
Mongoid::Criteria.delegate(:active_model_serializer, :to => :to_a) |
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 TicketsController < ApplicationController | |
def show | |
tickets = params[:tickets].split(",") | |
ticket_data = tickets.map do |ticket| | |
parallel { Faraday.get("http://tickets.local/#{ticket}") } | |
end | |
render json: { tickets: ticket_data.map(&:result) } | |
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
class CorsSupport | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
if preflight?(env) | |
env['HTTP_ORIGIN'] = 'file://' if env['HTTP_ORIGIN'] == 'null' | |
env['HTTP_ORIGIN'] ||= env['HTTP_X_ORIGIN'] |
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 Email < Message | |
attr_accessor :to, :cc, :bcc | |
validates :to, :presence => true, :on => :create | |
validates :to, :cc, :bcc, :emails => true | |
normalize_attribute :subject, :message | |
attr_accessible :to, :cc, :bcc, :subject, :message |
OlderNewer