Skip to content

Instantly share code, notes, and snippets.

@winston
winston / controller.rb
Created July 30, 2012 15:55
GoogleVisualr Gem - Stepped Area Chart Creation Example
# http://code.google.com/apis/chart/interactive/docs/gallery/steppedareachart.html#Example
def stepped_area_chart
data_table = GoogleVisualr::DataTable.new
data_table.new_column('string' , 'Director (Year)')
data_table.new_column('number' , 'Rotten Tomatoes')
data_table.new_column('number' , 'IMDB')
data_table.add_rows( [
['Alfred Hitchcock (1935)', 8.4, 7.9],
['Ralph Thomas (1959)', 6.9, 6.5],
@winston
winston / soloistrc
Created July 9, 2012 07:09
Consolidated soloistrc (Basic)
cookbook_paths:
- workspace
recipes:
######
## Meta OS X Base
- pivotal_workstation::osx_updates
- pivotal_workstation::set_finder_show_hd_on_desktop
- pivotal_workstation::defaults_fast_key_repeat_rate
- pivotal_workstation::function_keys
@winston
winston / soloistrc
Created February 8, 2012 08:26
Consolidated soloistrc (CI Image)
cookbook_paths:
- workspace
recipes:
######
## Meta OS X Base
- pivotal_workstation::java
- pivotal_workstation::sshd_on
- pivotal_workstation::screen_sharing_app
# - pivotal_workstation::Skype
@winston
winston / soloistrc
Created February 7, 2012 08:06
Consolidated soloistrc (Dev Image)
cookbook_paths:
- workspace
recipes:
######
## Meta OS X Base
- pivotal_workstation::osx_updates
- pivotal_workstation::set_finder_show_hd_on_desktop
- pivotal_workstation::defaults_fast_key_repeat_rate
- pivotal_workstation::function_keys
@winston
winston / gist:1680626
Created January 26, 2012 02:41
Rename Machine
scutil --set ComputerName #{hostname}
scutil --set LocalHostName #{hostname}
scutil --set HostName #{hostname}
hostname #{hostname}
diskutil rename / #{hostname}
@winston
winston / controller.rb
Created January 22, 2012 09:11
GoogleVisualr Gem - DataTabel with Roles Example
# http://code.google.com/apis/chart/interactive/docs/roles.html
def roles
data_table = GoogleVisualr::DataTable.new
data_table.new_column('string', 'Month')
data_table.new_column('number', 'Sales')
# Columns with role definition
data_table.new_column('number' , nil, nil, 'interval')
data_table.new_column('number' , nil, nil, 'interval')
data_table.new_column('string' , nil, nil, 'annotation')
@winston
winston / controller.rb
Created July 6, 2011 16:31
GoogleVisualr Gem - Tree Map Creation Example
# http://code.google.com/apis/chart/interactive/docs/gallery/treemap.html#Example
def tree_map
data_table = GoogleVisualr::DataTable.new
data_table.new_column('string', 'Region')
data_table.new_column('string', 'Parent')
data_table.new_column('number', 'Market trade volume (size)')
data_table.new_column('number', 'Market increase/decrease (color)')
data_table.add_rows( [
["Global" , nil , 0 , 0 ],
@winston
winston / controller.rb
Created July 5, 2011 16:22
GoogleVisualr Gem - Combo Chart Creation Example
# http://code.google.com/apis/chart/interactive/docs/gallery/combochart.html
def combo_chart
data_table = GoogleVisualr::DataTable.new
data_table.new_column('string', 'month' )
data_table.new_column('number', 'Bolivia' )
data_table.new_column('number', 'Ecuador' )
data_table.new_column('number', 'Madagascar' )
data_table.new_column('number', 'Papua Guinea')
data_table.new_column('number', 'Rwanda' )
@winston
winston / controller.rb
Created July 4, 2011 15:23
GoogleVisualr Gem - Geo Map Creation Example
# http://code.google.com/apis/chart/interactive/docs/gallery/geomap.html#Example
def geo_map
# Regions Example
data_table_regions = GoogleVisualr::DataTable.new
data_table_regions.new_column('string' , 'Country' )
data_table_regions.new_column('number' , 'Popularity')
data_table_regions.add_rows(6)
data_table_regions.set_cell(0, 0, 'Germany' )
data_table_regions.set_cell(0, 1, 200)
@winston
winston / controller.rb
Created July 4, 2011 15:04
GoogleVisualr Gem - Candlestick Chart Creation Example
# http://code.google.com/apis/chart/interactive/docs/gallery/candlestickchart.html
def candlestick_chart
data_table = GoogleVisualr::DataTable.new
data_table.new_column('string', 'day')
data_table.new_column('number', 'min')
data_table.new_column('number', 'opening')
data_table.new_column('number', 'closing')
data_table.new_column('number', 'max')
data_table.add_rows( [