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
def index | |
@weights = current_user.weights.all | |
@startdate = 30.days.ago.to_date | |
@pounds = (30.days.ago.to_date..Date.today).map { |date| Weight.pounds_on(date).to_f } | |
@h = LazyHighCharts::HighChart.new('graph') do |f| | |
f.options[:title][:text] = " " | |
f.options[:chart][:defaultSeriesType] = "area" | |
f.options[:chart][:inverted] = false |
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
<?php | |
scrape_wikipedia_flags(); | |
function scrape_wikipedia_flags( $max_height = 60 ) { | |
// Create a 'flags' directory inside whatever directory we're working in. | |
// We'll download our flags here | |
$dir = realpath(dirname(__FILE__)) . "/flags/"; | |
if(!is_dir($dir)) mkdir($dir,0777,true); |