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
# Sorts an array based on a property of each object within the array | |
# | |
# Examples: | |
# | |
# [Em.Object.create(a: 1), Em.Object.create(a: 5), Em.Object.create(a: 3)].sortProperty('a') | |
# > [{a: 1}, {a: 3}, {a: 5}] | |
# | |
# As a computed property: | |
# | |
# AC = Em.ArrayController.extend |
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
# gem 'aws-sdk' | |
require 'aws-sdk' | |
AWS.config(:access_key_id => '', :secret_access_key => '') | |
policy = '{ | |
"Id": "Policy1380877762691", | |
"Statement": [ | |
{ |
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
sudo apt-get update | |
sudo apt-get install curl | |
curl -L https://get.rvm.io | bash -s stable | |
source ~/.rvm/scripts/rvm | |
rvm requirements |
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 module = new function() { | |
var define, definitions, require; | |
definitions = {}; | |
define = function(moduleName, dependencies, fn) { | |
if (fn === undefined) { | |
fn = dependencies; | |
dependencies = []; | |
} | |
definitions[moduleName] = { | |
dependencies: dependencies, |
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 Project < ActiveRecord::Base | |
STATUS_TRANSITIONS = | |
{ | |
initial: :not_started, | |
not_started: { value: "On the board" }, | |
recommendation_sent: { value: "Recs: Recommendations Sent", event: :recommend}, | |
restarted: { event: :restart, to: :not_started } | |
} |
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
// Sublime 3, comes installed with Rails package. This also provide "Ruby Haml". If you press ctrl + alt + p and type haml you will probably see two Set Syntax: Ruby Haml. | |
// The best solution for me was also install ApplySyntax and in it's user settings add the following: | |
// Put your custom syntax rules here: | |
"syntaxes": [ | |
{ | |
// This rule could be incorporated into the next one, but I prefer to be | |
// more explicit rather than less | |
"name": "Haml/Syntaxes/Ruby Haml", |
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 File.expand_path('../boot', __FILE__) | |
require 'rails/all' | |
# Require the gems listed in Gemfile, including any gems | |
# you've limited to :test, :development, or :production. | |
Bundler.require(*Rails.groups) | |
# Load configs from config/application.yml | |
# config/application.yml | |
# default: &default |
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
#in helper/application_helper.rb | |
def authorize_resources | |
unless user_signed_in? | |
redirect_to new_user_session_path | |
end | |
end | |
#in application_controller |
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
#starting sublime, opening whole directory and in background | |
#in .zshrc | |
alias e="path-to-sublime-executable ./ &" | |
#setting terminal real transparent (after setting metacity for windows manager ) | |
gconftool-2 /apps/metacity/general/compositing_manager --type bool --set true |
OlderNewer