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
func extractLatLng(data []byte) (float64, float64) { | |
res := make(map[string][]map[string]map[string]map[string]interface{}, 0) | |
json.Unmarshal(data, &res) | |
lat, _ := res["results"][0]["geometry"]["location"]["lat"].(float64) | |
lng, _ := res["results"][0]["geometry"]["location"]["lng"].(float64) | |
return lat, lng | |
} |
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
#!/usr/bin/ruby | |
STDOUT.sync = true #makes print flush | |
now = Time.new | |
twentyfive = now + 25*60 | |
puts "pomodoro ends #{twentyfive}" | |
while now < twentyfive do | |
sleep 1 | |
now = Time.new | |
print "." | |
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
%html | |
%head | |
%title | |
Inline Tiny MCE example | |
= stylesheet_link_tag :all | |
= javascript_include_tag 'jquery' | |
= javascript_include_tag 'rails' | |
= javascript_include_tag 'application' | |
= include_tiny_mce_if_needed | |
= csrf_meta_tag |