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
| var data = <%= @deck.stats.curve.to_json.html_safe %>; | |
| var ctx = document.getElementById("curve").getContext("2d"); | |
| new Chart(ctx).Bar(data); | |
| # Output from @deck.stats.curve | |
| {:labels=>["1", "2", "3", "4", "5", "6", "7"], | |
| :datasets=>[{:fillColor=>"rgba(220,220,220,0.5)", | |
| :strokeColor=>"rgba(220,220,220,1)", | |
| :data=>[11, 9, 5, 6, 1, 6, 3]}]} |
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
| class ArrayDiff | |
| attr_reader :one, :two | |
| def initialize one, two | |
| @one, @two = one.to_a, two.to_a | |
| end | |
| def deletions | |
| one_dup = one.clone | |
| two.each { |x| one_dup.slice!(one_dup.index(x)) if one_dup.index(x) } |
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 set_all args = {} | |
| args.each do |key, value| | |
| send "#{key}=", value | |
| end | |
| 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
| namespace :ember do | |
| task :update do | |
| [['~/.ember', 'git://github.com/emberjs/ember.js.git', 'ember.js'], | |
| ['~/.ember-data', 'git://github.com/emberjs/data.git', 'ember-data.js'] | |
| ].each { |i| EmberBuild.new(*i).update } | |
| end | |
| end | |
| class EmberBuild | |
| attr_reader :ember_dir, :repo, :file_name, :gem_file |
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
| task :cron => [ :environment, :email ] do | |
| end | |
| task :email do | |
| if Time.now.hour % 6 == 0 | |
| # Send Email | |
| end | |
| end |
NewerOlder