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
#!/usr/bin/env ruby | |
# This is a basic deploy script for Heroku apps. | |
# It provides a structure you can use to expand on | |
# and add your own prereqs and deploy tasks. | |
# | |
# It basically ensures that: | |
# 1. There are no uncommited files | |
# 2. You can ssh to github | |
# 3. You can connect to heroku |
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
source "https://rubygems.org" | |
gem 'sprockets' | |
gem 'sprockets-sass' | |
gem 'sass' | |
gem 'compass' | |
gem 'bootstrap-sass' | |
gem 'handlebars_assets' | |
gem 'coffee-script' |
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
#Go to bitly.com/a/your_api_key | |
#Copy your bitly username and bitly api key from that page. | |
#Open bulk_bitly.rb and put in your username and api_key in. | |
#The script takes all the links in a file called input.txt and creates a file | |
#called output.csv. Please look at the format of input.txt and create a text file the same way. | |
#Running the script bulk_bitly.rb: | |
#You'll need to install a ruby gem called "bitly". | |
#$ gem install bitly | |
#then cd into this folder from your terminal. If the folder is on your desktop do this: | |
#$ cd ~/Desktop/bitly |
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 'rake-pipeline' | |
require 'rake-pipeline/middleware' | |
use Rake::Pipeline::Middleware, 'Assetfile' | |
# require 'rack/streaming_proxy' | |
# use Rack::StreamingProxy do |request| | |
# if request.path.start_with?('/proxy') | |
# path = request.path | |
# if request.query_string | |
# path = "#{path}?#{request.query_string}" |
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
CREATE OR REPLACE FUNCTION escape_json (text) RETURNS text AS $$ | |
SELECT replace($1, '''', '\'''); $$ LANGUAGE SQL IMMUTABLE; | |
CREATE OR REPLACE FUNCTION to_json(text) RETURNS text AS $$ | |
SELECT escape_json($1) $$ LANGUAGE SQL IMMUTABLE; | |
CREATE OR REPLACE FUNCTION to_json(KEY text, value text) RETURNS text AS $$ | |
SELECT '''' || to_json($1) || ''': ''' || to_json($2) || ''''; $$ LANGUAGE SQL IMMUTABLE; |
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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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
var callMethod = function(target, method, args) { | |
if (Ember.typeOf(method) === 'string') { | |
method = target[method]; | |
} | |
return method.apply(target, args); | |
}; | |
/** | |
Returns a function, that, when invoked, will only be triggered at most once during a given window of time. | |
*/ |
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
var testing = function(app){ | |
var container = app.__container__, | |
appController = container.lookup('controller:application'), | |
router = container.lookup("router:main"); | |
var helper = { | |
path: function(){ | |
return appController.get('currentPath'); | |
}, | |
routeName: function(){ |
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
// Ember.Model has slowly developed a stable API. Lets make it an interface. | |
Ember.Model = Ember.Object.extend(Ember.Evented, { | |
/** | |
Reference the original json that created the record. | |
@method data | |
@returns {Object} of data used to create the record | |
*/ | |
data: Ember.K, |
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
helpers = function EmberHelpers(App){ | |
var app = App, | |
container = app.__container__; | |
var helper = { | |
routes: function(){ | |
return app.Router.router.recognizer.names; | |
}, | |
lookup = function(path){ | |
return container.lookup(path); | |
}, |
OlderNewer