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
| require 'squib' | |
| # This makes use of Ruby's heredoc - it's just a string | |
| data = Squib.csv data:(<<-CSV) | |
| Name,Cost,Friend | |
| Stringer,3,Avon | |
| Avon,2,Stringer | |
| CSV | |
| Squib::Deck.new(cards: data.nrows, width: 300, height: 300) do |
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
| require 'json' | |
| require 'csv' | |
| puts "Parsing..." | |
| data = JSON.parse(File.read('LocationHistory.json')) | |
| puts "Saving..." | |
| CSV.open("locations.csv", "w+") do |csv| | |
| headers = %w( timestampMs latitudeE7 longitudeE7 accuracy ) | |
| headers += (0..10).to_a.map { |i| "activity_#{i}" } | |
| csv << headers |
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
| require 'cairo' | |
| require 'pango' | |
| cxt = Cairo::Context.new(Cairo::ImageSurface.new(200,200)) | |
| puts "Our outer CR is: #{cxt.inspect}" | |
| cxt.set_source_color('white') | |
| cxt.paint | |
| cxt.set_source_color('red') | |
| extent_width = 200 |
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
| _output |
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
| _output/* |
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
| _output/* |
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
| _output/* |
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
| _output/* |
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
| _output/* |
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
| *.png |
NewerOlder