- Slowly being introduced as bundler starts to show it's age
- Already working well and coming out of beta
- Caching (github, gem, ext)
- Multi-source (now safe to do)
- No more platform issues (win vs linux vs unix)
- We should prepare to migrate soon
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
curl -O https://ufpr.dl.sourceforge.net/project/icu/ICU4C/58.2/icu4c-58_2-src.tgz | |
tar xzvf icu4c-58_2-src.tgz | |
cd icu/source | |
chmod +x runConfigureICU configure install-sh | |
./runConfigureICU MacOSX | |
make | |
sudo make install |
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
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
Database files have to be updated before starting the server, here are the steps that had to be followed: | |
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
brew unlink postgresql | |
brew install postgresql@9.6 | |
brew unlink postgresql@9.6 | |
brew link postgresql |
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
config.assets.precompile += [ | |
# precompile any CSS or JS file that doesn't start with _ | |
/(^inline[^_\/]|\/[^_])[^\/]*.(js|css)$/, | |
... |
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 :staging do | |
desc 'create subdomain DNS record for Heroku review app' | |
task :publish_dns do | |
require 'dnsimple' | |
require 'platform-api' | |
STAGING_DOMAIN = 'mystagingdomain.com'.freeze | |
DNSIMPLE_ACCOUNT_ID = .freeze | |
heroku_app_name = ENV['HEROKU_APP_NAME'] | |
subdomain = heroku_app_name.match(/.*(pr-\d+)/).captures.first |
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
# Ruby on Rails console load error after brew update | |
# Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError) | |
ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib |
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
# Mock Redis | |
class MockRedis | |
attr_accessor :store | |
def initialize | |
@store = {} | |
end | |
def flushall | |
@store = {} |
- Add
gem 'rails_12factor'
to your Gemfile. This will add error logging and the ability for your app to serve static assets. bundle
- Run
RAILS_ENV=production rake db:create db:migrate db:seed
- Run
rake secret
and copy the output - From the command line:
export SECRET_KEY_BASE=output-of-rake-secret
- To precompile your assets, run
rake assets:precompile
. This will create a folderpublic/assets
that contains all of your assets. - Run
RAILS_ENV=production rails s
and you should see your app.
Remember to clobber your assets (rake assets:clobber
) and re-precompile (rake assets:precompile
) if you make changes.
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
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" |
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
// Copies 'text' to clipboard. Doesn't depends on id's, targets. Just text. | |
const copyToClipboard = (text) => { | |
const el = document.createElement('input'); | |
document.body.appendChild(el); | |
el.value = text; | |
el.select(); | |
el.setSelectionRange(0, 99999); /*For mobile devices*/ | |
document.execCommand("copy"); | |
document.body.removeChild(el); | |
}; |