subl
- Understanding the Unix Environment
- Homebrew
- sqlite3
- postgres
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
cat > Dockerfile <<\EOF | |
FROM ubuntu:12.04 | |
RUN apt-get update | |
RUN apt-get install -y ruby1.9.3 build-essential \ | |
libc6-dev libffi-dev libgdbm-dev libncurses5-dev \ | |
libreadline-dev libssl-dev libyaml-dev zlib1g-dev | |
RUN gem install fpm --bindir=/usr/bin --no-rdoc --no-ri | |
RUN apt-get install -y curl | |
RUN curl ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.gz|tar oxzC /tmp | |
WORKDIR /tmp/ruby-1.9.3-p484 |
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 Product < ActiveRecord::Base | |
def self.find_by_criteria(params) | |
query = where("id IS NOT null") # A little odd but not sure how to get an ActiveRecord::Relation that returns "all" | |
query = query.where("price = ?", params[:price]) if params[:price].present? | |
query = query.where("manufacturer = ?", params[:manufacturer]) if params[:manufacturer].present? | |
query = query.where("retailer = ?", params[:retailer]) if params[:retailer].present? | |
query = query.where("category = ?", params[:category]) if params[:category].present? | |
query | |
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
source :rubygems |
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
# Include alias file | |
if [ -f ~/.aliases ] | |
then | |
source ~/.aliases | |
fi |
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
namespace :deploy do | |
HEROKU_ACCOUNT = "account_name" | |
MAINLINE_BRANCH = "master" | |
STAGING_REPO = "app-name-staging" | |
PRODUCTION_REPO = "app-name-production" | |
def make_git_timestamp | |
"#{@env}-deploy-#{Time.now.to_s.gsub(/:/, "-").gsub(/\s/, "-").gsub(/--/, "-")}" | |
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
# A sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
group :interactive do | |
guard 'spork', :rspec_env => {'RAILS_ENV' => 'test'}, :wait => 50 do | |
watch('config/application.rb') | |
watch('config/environment.rb') | |
watch(%r{^config/environments/.+\.rb$}) | |
watch(%r{^config/initializers/.+\.rb$}) |
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.TinymceEditorComponent = Ember.Component.extend({ | |
// Warning!!! only use tinyMCE not tinymce !!! | |
editor: null, | |
data: {}, | |
watchData: true, | |
didInsertElement: function(){ | |
var _this = this; | |
// The magic config - http://www.tinymce.com/wiki.php/Configuration | |
var config = {}; |
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
function ajax(url, options) { | |
return new Ember.RSVP.Promise(function (resolve, reject) { | |
options = options || {}; | |
options.url = url; | |
options.success = function (data) { | |
Ember.run(null, resolve, data); | |
}; | |
options.error = 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
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
init() { | |
this._super(...arguments); | |
$.mockjax({ | |
url: '/api/mock', | |
responseText: { | |
text: "someText" |
OlderNewer