Skip to content

Instantly share code, notes, and snippets.

View owendall's full-sized avatar

Owen Dall Sotomayor owendall

View GitHub Profile
class Contact < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
name :string
timestamps
end
belongs_to :title
<include src="rapid" plugin="hobo"/>
<include src="taglibs/auto/rapid/cards"/>
<include src="taglibs/auto/rapid/pages"/>
<include src="taglibs/auto/rapid/forms"/>
<set-theme name="clean"/>
<def tag="app-name">My First App</def>
<include src="rapid" plugin="hobo"/>
<include src="taglibs/auto/rapid/cards"/>
<include src="taglibs/auto/rapid/pages"/>
<include src="taglibs/auto/rapid/forms"/>
<set-theme name="clean"/>
<def tag="app-name">My First App</def>
class Archive < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
name :string
timestamps
end
belongs_to :workspace
<!-- AUTOMATICALLY GENERATED FILE - DO NOT EDIT -->
<def tag="form" for="Contact">
<form merge param="default">
<error-messages param/>
<field-list fields="name, company, description" param/>
<div param="actions">
<submit label="#{ht 'contacts.actions.save', :default=>['Save']}" param/><or-cancel param="cancel"/>
</div>
</form>
class Import
attr_accessor :file, :dry_run
attr_reader :encoding, :imported
def initialize(params={})
@dry_run = true
params.each do |key, value|
send("#{key}=", value)
end
def load(id)
options_for_find
@clazz.first(
:conditions => { @clazz.primary_key => id.to_i}
)
end
def load_all(ids)
options_for_find
@clazz.all(
@owendall
owendall / index.html
Created May 12, 2012 14:30
State Heap Map - Using the Google GeoMap (Flash Rendered) API
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Google Visualization API Sample</title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1.1', {packages: ['geomap']});
/** 2012-05-12: Data are draft and not for publication **/
@owendall
owendall / index.html
Created May 12, 2012 17:12
Sample geomap with markers instead of state shading
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Google Visualization API Sample</title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1.1', {packages: ['geomap']});
/** 2012-05-12: Data are draft and not for publication **/
@owendall
owendall / index.html
Created May 12, 2012 19:19
State Heap Map - All States - Using GeoChart API (SVG Rendered) Version
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Google Visualization API Sample</title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1.1', {packages: ['geochart']});
/** 2012-05-12: Data are draft and not for publication **/