Here are some resources that I found helpful and found inspiration from when I was writing the talk.
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 Base | |
module_function | |
BASE_CHARACTERS = '0123456789BCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz' | |
def encode(int) | |
str = '' | |
while int > 0 | |
character = int % BASE_CHARACTERS.length | |
int = int / BASE_CHARACTERS.length | |
str = BASE_CHARACTERS[character..character] + str |
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
# Optimized regex for finding urls | |
# Top level domain list from: http://data.iana.org/TLD/tlds-alpha-by-domain.txt | |
/(?:^|\s)(?:http[s]?:\/\/)?(?:www\.)?([-a-zA-Z_\.]*\.(?:a(?:[cdfgilmnoqtuwxz]|e(?:ro)?|r(?:pa)?|s(?:ia)?)|b(?:[abdefghjmnorstvwyz]|i(?:z)?)|c(?:[cdfghiklmnruvxyz]|a(?:t)?|o(?:m|op)?)|d(?:[ejkmoz])|e(?:[cegrstu]|du)|f(?:[ijkmor])|g(?:[abdefghilmnpqrstuwy]|ov)|h(?:[kmnrtu])|i(?:[delmoqrst]|n(?:fo|t)?)|j(?:[emp]|o(?:bs)?)|k(?:[eghimnprwyz])|l(?:[abcikrstuvy])|m(?:[acdeghklmnpqrstvwxyz]|il|o(?:bi)?|u(?:seum)?)|n(?:[cfgilopruz]|a(?:me)?|e(?:t)?)|o(?:m|rg)|p(?:[aefghklmnstwy]|r(?:o)?)|q(?:a)|r(?:[eosuw])|s(?:[abcdeghijklmnortuvyz])|t(?:[cdfghjklmnoptvwz]|el|r(?:avel)?)|u(?:[agksyz])|v(?:[aceginu])|w(?:[fs])|xn--(?:0zwm56d|11b5bs3a9aj6g|80akhbyknj4f|9t4b11yi5a|deba0ad|g6w251d|hgbk6aj7f53bba|hlcj6aya9esc7a|jxalpdlp|kgbechtv|zckzah)|y(?:[etu])|z(?:[amw]))(?:[\/]?|(?:[\/]??[-a-zA-Z_\.\/?=&]*)))(?:[,\!\.\?])?(?:\s|$)/iu |
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
source "http://rubygems.org" | |
gem 'fog' |
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
server_data = compute.create_server( | |
1, | |
49 | |
).body['server'] | |
until compute.get_server_details( | |
server_data['id'] | |
).body['server']['status'] == 'ACTIVE' | |
end |
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
require 'fog' | |
compute = Fog::Compute.new(:provider => 'VirtualBox') | |
server = compute.servers.create(:name => 'lucid', :os => 'Ubuntu') | |
medium = compute.mediums.create(:device_type => :hard_disk, :location => '/Users/geemus/geemus/virtualbox_poc/lucid.vmdk', :read_only => false) | |
storage_controller = server.storage_controllers.create(:bus => :sata, :name => 'sata') | |
storage_controller.attach(medium, 0) |
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
# on ubuntu, ensure appropriate ruby-dev is also installed | |
hg clone https://vim.googlecode.com/hg/ vim | |
cd vim | |
./configure --enable-multibyte --enable-rubyinterp | |
make && make install |
Details on the competition: http://www.myfukuoka.com/events/2012-fukuoka-ruby-award-competition
Explain briefly functions and feature.
fog provides a consistent, simple interface to many cloud services. Whether utilizing computing, DNS, storage or other cloud resources, fog's simple interface helps new users get started quickly and easily, find the best provider for their needs, and migrate easily when those needs change. Because of it's open source license and the community built around it, fog also allows for quick extension of its interface when new cloud products and features are released.
TODO empty arrays and/or nil values (see apps:info)
- Use full sentences, including punctuation.
- Labels should be provided where needed in the form of 'Labels labels:'.
- Commands should have one newline between the header and body and another after the body.
- Alpha-sort arrays before display and display labeled data in alpha-sorted key order.
$ heroku help apps:create
## Usage:
heroku apps:create [NAME]
## Description:
create a new app
## Options:
--addons ADDONS
a comma-delimited list of addons to install
-b, --buildpack BUILDPACK
a buildpack url to use for this app
OlderNewer