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
# Use this setup block to configure all options available in SimpleForm. | |
SimpleForm.setup do |config| | |
config.error_notification_class = 'alert alert-danger' | |
config.button_class = 'waves-effect waves-light btn' | |
config.boolean_label_class = nil | |
config.wrappers :vertical_form, tag: 'div', class: 'input-field', error_class: 'has-error' do |b| | |
b.use :html5 | |
b.use :placeholder | |
b.optional :maxlength |
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
Initialize Digital Ocean Droplet, add SSH key(s) | |
ssh root@<IP> | |
# Fix locales | |
sudo nano /etc/environment | |
LANGUAGE=en_US.UTF-8 | |
LC_ALL=en_US.UTF-8 | |
sudo locale-gen en_US.UTF-8 | |
sudo dpkg-reconfigure locales | |
sudo reboot |
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
# Mina Deploy | |
# =========== | |
# | |
# Adapted from Creative deploy stack in Manabalss v4, Mar.2015 | |
# On first deploy do: mina setup --verbose | |
# Then do : mina deploy --trace | |
# | |
# Usage: | |
# mina deploy --verbose # Standard deploy task | mina deploy[hard,seed] to hard-reset and seed | |
# mina rake[db:seed] |
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
# in config/puma.rb | |
app = "cpp" # App-specific | |
root = "/home/deployer/apps/#{app}" | |
workers 5 | |
threads 1, 1 | |
#preload_app! | |
rackup DefaultRackup | |
#port 9292 |
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
If you are on windows, start by setting up an Ubuntu in a VirtualBox | |
= http://www.psychocats.net/ubuntu/virtualbox | |
First you wanna update Ubuntu | |
$ sudo apt-get update | |
$ sudo apt-get upgrade | |
$ sudo apt-get dist-upgrade | |
$ sudo reboot | |
Add repositories |
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
# /config/puma.rb | |
app = "manabalss" # App-specific | |
root = "/home/deployer/apps/#{app}" | |
workers 5 | |
threads 1, 1 # relying on many workers for thread-unsafe apps | |
rackup DefaultRackup | |
port 11592 |
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
# create a mongo app | |
flynn create --remote "" mongo | |
# create a release using the latest (at the time of writing) Docker MongoDB image | |
flynn -a mongo release add -f config.json "https://registry.hub.docker.com?name=mongo&id=216d9a0e82646f77b31b78eeb0e26db5500930bbd6085d5d5c3844ec27c0ca50" | |
# scale the server to one process. This may time out initially as the server pulls the image, but watch "flynn -a mongo ps" and it should come up. | |
flynn -a mongo scale server=1 | |
# mongo should now be running in the cluster at mongo.discoverd:27017 |
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
// PATTERN 1: DEFINE A GLOBAL | |
// foo.js | |
foo = function () { | |
console.log('foo!'); | |
} | |
// app.js | |
require('./foo.js'); | |
foo(); |
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
curl get.pow.cx/uninstall.sh | sh | |
curl get.pow.cx | sh | |
scutil --dns | |
sudo touch /etc/resolver/dev | |
sudo pfctl -f /etc/pf.conf | |
sudo pfctl -e | |
touch ~/.pow/rails |
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
module ActiveRecordMarshalable | |
def marshal_dump | |
[attributes, self.association_cache, instance_variable_get(:@new_record)] | |
end | |
def marshal_load data | |
send :initialize, data[0] | |
instance_variable_set :@association_cache, data[1] | |
instance_variable_set :@new_record, data[2] | |
end |