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
task :cron => [ :environment, :email ] do | |
end | |
task :email do | |
if Time.now.hour % 6 == 0 | |
# Send Email | |
end | |
end |
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
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 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 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 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 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
# Install the Ruby library | |
gem install dnsimple-ruby | |
# Check if a domain is available | |
DNSimple::Domain.check(your_domain_name) == 'available' | |
# Register a domain | |
domain = DNSimple::Domain.register(domain_name) | |
# Apply a template to your domain |
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
exports.config = | |
# See http://brunch.io/#documentation for docs. | |
files: | |
javascripts: | |
joinTo: 'app.js': /^(app|vendor|bower_components)/ | |
order: | |
before: [ | |
'bower_components/jquery/jquery.js' | |
'bower_components/handlebars/handlebars.js' | |
'bower_components/ember/ember.js' |
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
window.App = Ember.Application.create(); | |
require('store'); | |
require('router'); | |
var folderOrder = [ 'routes', 'models', 'views', 'controllers', 'helpers', | |
'templates', 'components' ]; | |
folderOrder.forEach(function(folder) { | |
window.require.list().filter(function(module) { |
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
DS.RESTAdapter.reopen({ | |
namespace: 'api/1', | |
serializer: DS.RESTSerializer.extend({ | |
primaryKey: function(type) { | |
return '_id'; | |
} | |
}) | |
}); |
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
App.Router.map(function() { | |
return this.resource('todos', { | |
path: '/' | |
}, function() {}); | |
}); |
OlderNewer