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
# 1) Point *.example.com in your DNS setup to your server. | |
# | |
# 2) Setup an Apache vhost to catch the star pointer: | |
# | |
# <VirtualHost *:80> | |
# ServerName *.example.com | |
# </VirtualHost> | |
# | |
# 3) Set the current account from the subdomain | |
class ApplicationController < ActionController::Base |
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
#!/bin/sh | |
export RUBY_HEAP_MIN_SLOTS=500000 | |
export RUBY_HEAP_SLOTS_INCREMENT=250000 | |
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 | |
export RUBY_GC_MALLOC_LIMIT=500000000 | |
/opt/ruby-enterprise/bin/ruby $* |
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
GameRouter = new Backbone.Router.extend | |
routes: | |
"draw": "draw" | |
initialize: -> | |
this.gameView = new GameView() | |
Backbone.history.start() | |
draw: -> | |
this.gameView.draw(); |
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 Deal < ActiveRecord::Base | |
belongs_to :store | |
has_many :categories, :as => :categorizable | |
end | |
class Store < ActiveRecord::Base | |
has_many :deals | |
has_many :categories, :as => :categorizable | |
has_many :coupons, :through => :categories | |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
## README | |
# This is a quick script I hacked out to migrate all my heroku apps | |
# to the new free individual postgres DBs. To use it: | |
# - install the heroku gem if you don't already have it | |
# - set the value of IGNORE_OTHERS_APPS to true if you only want to | |
# run the script against apps you've created yourself | |
# - add any apps you want to ignore because they don't use PostgreSQL | |
# (or for any other reason) to the IGNORE_LIST | |
## CAVEAT!! |
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
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
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
if !params[:searchable].present? | |
params[:searchable] = {} | |
end | |
params[:searchable][:account_id] = @account.id |
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
%span.btn-group.add-item-expanded | |
= link_to 'View', account_select_event_item_path(item.account, item.select_event, item), method: :get, :class => "btn fooda-white" | |
= form_for :info, url: checkout_items_path do |f| | |
= f.hidden_field :parent_id, value: @menu_page.select_event.id | |
= f.hidden_field :parent_type, value: 'SelectEvent' | |
= f.hidden_field :item_id, value: item.inventory_item_id | |
= f.hidden_field :item_type, value: "InventoryItem" | |
= f.text_field :instructions | |
= f.text_field :options | |
= f.submit 'Buy Now', :class => "btn fooda-blue" |
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
# They do different things. exec replaces the current process with the new process. | |
# system invokes another process and returns its exit value to the current process. | |
# backticks invokes another process and returns the output of that process to the current process. | |
while true | |
puts `bundle exec rspec 'spec/dev_free_ipad_idempotent_spec.rb'` | |
end |
OlderNewer