heroku addons:add heroku-postgresql:standard-0 --remote staging
heroku maintenance:on --remote staging
heroku ps:scale worker=0 --remote staging
heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_PINK --remote staging
heroku pg:promote HEROKU_POSTGRESQL_PINK --remote staging
heroku ps:scale worker=1 --remote staging
heroku maintenance:off --remote staging
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
This gist is the update of this post https://u.osu.edu/hasnan.1/2014/03/30/rails-4-multiple-file-upload-with-carrierwave-nested-form-and-jquery-file-upload/ | |
License MIT |

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
# This file is copied to spec/ when you run 'rails generate rspec:install' | |
ENV['RAILS_ENV'] ||= 'test' | |
require File.expand_path('../../config/environment', __FILE__) | |
require 'rspec/rails' | |
#require 'spec_helper' | |
require 'capybara/rspec' | |
require 'capybara/rails' | |
require 'capybara/poltergeist' |
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
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new | |
Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-1420780-22', 'auto'); | |
ga('send', 'pageview'); | |
</script> | |
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 API::V1::BaseController < ApplicationController | |
skip_before_filter :verify_authenticity_token | |
before_filter :cors_preflight_check | |
after_filter :cors_set_access_control_headers | |
def cors_set_access_control_headers | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' |
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
<script type='text/javascript'> | |
//... | |
//... | |
gptadslots[6]= googletag.defineSlot('/72776159/LifeandStyle/' + var_section, [[300,250]],'box_4').defineSizeMapping(mappingBox).setTargeting('pos',['6']).addService(googletag.pubads()); | |
// ... | |
//... | |
</script> | |
<div id='box_4'> | |
<script type='text/javascript'> |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
-
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>
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
# Console postgres command: | |
$ sudo -u postgres psql | |
# list users | |
\du | |
$ sudo su - postgres | |
$ psql |