Skip to content

Instantly share code, notes, and snippets.

@flowerett
flowerett / rails-options
Created January 12, 2017 21:42
rails new options
rails new --help
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /Users/flowerett/.rvm/rubies/ruby-2.3.3/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
-d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
# Default: sqlite3
@flowerett
flowerett / mina tag version
Last active January 12, 2017 21:44
Mina git tag
Tag deployed git sha with the current release version
1. mina deploy --simulate > script.sh
Take a look at the script, and decide where you want your command to go.
2. Figure out how to do what you want in a shell command, for instance, it might be something like VERSION=$(cat version.txt) git tag -a -m "$VERSION" HEAD; git push --tags
3. Add a line in the appropriate spot to config/deploy.rb saying queue %( VERSION=$(cat version.txt) git tag -a -m "$VERSION" HEAD; git push --tags )
@flowerett
flowerett / elastic_default.rb
Created April 6, 2016 06:55
Elasticsearch chef recipe
#
# Cookbook Name:: elasticsearch
# Recipe:: default
#
# Credit goes to GoTime for their original recipe ( http://cookbooks.opscode.com/cookbooks/elasticsearch )
if ['solo', 'util'].include?(node[:instance_role])
elasticsearch_instances = []
elasticsearch_expected = 0
instances = node[:engineyard][:environment][:instances].select{|i| ['util', 'solo'].include?(i['role']) }
@flowerett
flowerett / osx-10.11-setup.md
Created January 2, 2016 15:35 — forked from kevinelliott/osx-10.11-setup.md
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

require 'minitest/autorun'
class Integer
# rules:
# - Si a la derecha de una cifra romana de escribe otra igual o menor, el valor de ésta se suma a la anterior.
# - La cifra "I" colocada delante de la "V" o la "X", les resta una unidad; la "X", precediendo a la "L" o a la "C", les resta diez unidades y la "C", delante de la "D" o la "M", les resta cien unidades.
# - En ningún número se puede poner una misma letra más de tres veces seguidas. En la antigüedad se ve a veces la "I" o la "X" hasta cuatro veces seguidas.
# - La "V", la "L" y la "D" no pueden duplicarse porque otras letras ("X", "C", "M") representan su valor duplicado.
# - Si entre dos cifras cualesquiera existe otra menor, ésta restará su valor a la siguiente.