This file contains 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 "rubygems" | |
require "net/http" | |
require "open-uri" | |
data = open("http://cdo.ncdc.noaa.gov/climatenormals/clim84/IL/IL110055.txt").map | |
#data = open("http://cdo.ncdc.noaa.gov/climatenormals/clim84/IL/IL112679.txt").map | |
metric = {} | |
metric[:station_coop_id] = data[4][44..49] |
This file contains 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
extract.formula<-function(formu){ | |
if (!is(formu,"formula")) | |
stop("X should be a valid formula of form \n y ~ x1 + x2 | conditional") | |
resp <- formu[[2]] | |
if( length(formu[[3]]) < 2 ){ formu <- formu }else{ formu <- formu[[3]] } | |
flattener <- function(f) {if (length(f)<3) return(f); | |
c(Recall(f[[2]]),Recall(f[[3]]))} | |
if (formu[[1]] == '|'){ |
This file contains 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 containing a collect_kv method to allow | |
# a new hash to be generated my collect instead | |
# of returning an array of modified keys or values | |
module CollectKeyValue | |
# Takes a block that returns a [key, value] pair | |
# and builds a new hash based on those pairs | |
def collect_kv | |
result = {} | |
each do |k,v| |
This file contains 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
var minnesota = [{name:"job 1", values:[182904,196530,203944,192492,77393,81243]}]; | |
$(document).ready(function(){ | |
$("button").click(function(){ | |
minnesota = [{name:"changed job", values:[342,34234,2342,543]}]; | |
draw(); | |
}); | |
}); |
This file contains 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 rvmrc file | |
create_file ".rvmrc", "rvm gemset use #{app_name}" | |
gem "haml-rails" | |
gem "sass" | |
# hpricot and ruby_parser required by haml | |
gem "hpricot", :group => :development | |
gem "ruby_parser", :group => :development | |
gem "nifty-generators" | |
gem "simple_form" |
This file contains 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
<html> | |
<head> | |
<script> | |
document.onclick = function(evt) { | |
var el = window.event? event.srcElement : evt.target; | |
if (el && el.className == "unselected") { | |
el.className = "selected"; | |
var siblings = el.parentNode.childNodes; | |
for (var i = 0, l = siblings.length; i < l; i++) { | |
var sib = siblings[i]; |
This file contains 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
$nav_elements: home, bio, shows, music, video, photos, store; | |
$nav_element_positions: 86px, 55px, 62px, 82px, 88px, 103px, 94px; | |
@each $element,$position in $nav_elements,$nav_element_positions { | |
ul li.nav_#{$element} a { | |
width: $position; } | |
} |
This file contains 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
/* =Menu | |
-------------------------------------------------------------- */ | |
div.menu { width: 570px; height: 72px; float: left; margin: 0 auto; padding: 22px 0 0 0; } | |
div.menu ul { width: 570px; height: 33px; margin: 0; padding: 0; float: left; background: url("images/mainnav.gif") no-repeat top left; } | |
div.menu ul li { list-style-type: none; float: left; margin: 0; padding: 0; display: inline; height: 33px; } | |
div.menu ul li a { display: block; height: 33px; text-indent: -9999px; outline: none; margin: 0; } | |
div.menu ul li.nav_home a { width: 86px; } | |
div.menu ul li.nav_bio a { width: 55px; } | |
div.menu ul li.nav_shows a { width: 62px; } |
This file contains 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
= render :partial => 'shared/feed_item', :collection => @feed_items | |
.pagination | |
= link_to_next_page @feed_items, "More", :remote => true |
OlderNewer