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
# Setup in a scenario way with perform the basic action that we have from base_actions controller | |
# | |
# Emulate or possibly just use the callbacks from within rails | |
# https://github.com/rails/rails/blob/master/actionpack/lib/abstract_controller/callbacks.rb | |
# | |
# This gives us the before_/after_/around_ filters along with a `run_callbacks` method | |
class BaseUpdateAction | |
def perform(method) | |
saved = each_from_parameters(params[collection_name]) do |model_hash| | |
# Need a way to get access to the model we're getting, but I haven't dug into the run_callbacks method |
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
# First you'll want to make sure to install ember-cli | |
# Install 0.1.12 explicitely until we make sure the latest is working. I ran into several first-run issues on the newest version. | |
npm install -g [email protected] | |
# Then create the initial project. This will create all the basic files you need | |
# install the npm and bower dependencies and create an initial git commit. | |
ember new todo | |
cd todo/ | |
# Now install coffeescript. We use the ember-cli-coffees6 so we don't need |
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 'imgkit' | |
require 'dimensions' | |
require 'nokogiri' | |
require 'net/http' | |
require 'uri' | |
count = 0 | |
def get_url(original_url, count, redirect_url = nil, limit = 10) | |
raise ArgumentError, 'HTTP redirect too deep' if limit == 0 |
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
// Please wait a bit. | |
// Compiled script is not shown while source map is being loaded! |
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'; | |
initialize = function(container, app) { | |
container.lookup('route:application').reopen({ | |
error: function(error, transition, originRoute) { | |
// Something happens here to prepare the object | |
// Then we report it to the main application | |
report(modifiedError); | |
} | |
}); |
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
## Links ## | |
- [Sprintly Story](https://url.to.sprintly.story) | |
- [Staged Site](http://url.to.staged.site) | |
## Summary ## | |
- High level list | |
- Of major | |
- Changes | |
**Notes**: Any additional context here |
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
# Postgres | |
source <(curl -s https://gist.githubusercontent.com/nathanpalmer/aa102e03ab3c9432f8c5/raw/718f019bfef9984c4aaf6feaa559809bf014039f/install-postgres.sh) | |
# Redis | |
sudo apt-get install redis-server redis-tools -y | |
# RVM | |
source <(curl -s https://gist.githubusercontent.com/nathanpalmer/b00226cc57a3eaed3110/raw/ef458d3c21f1350d595cb674737e9eb47f87c79b/install-rvm.sh) | |
# Other things we need |
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 bash | |
# install rvm | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3 | |
curl -sSL https://get.rvm.io | bash -s stable | |
source /etc/profile | |
rvm install ruby-2.1.2 |
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 bash | |
# make sure it's setup as UTF-8 by default | |
update-locale LANG=C.UTF-8 LC_ALL=C.UTF-8 | |
dpkg-reconfigure locales | |
# install postgres | |
apt-get update | |
apt-get -y install postgresql-9.3 postgresql-server-dev-9.3 postgresql-contrib-9.3 | |
sed -i '/local all all peer/c\local all all trust' /etc/postgresql/9.3/main/pg_hba.conf |
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
def main_method | |
puts '1: Start' | |
some_method_with_block do | |
puts '2: Inside' | |
fail 'Something bad happened' | |
end | |
puts '3: Finish' | |
end | |
def some_method_with_block |