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
@staticmethod | |
def get_adjacent_robots(self, game, player_comparator=None): | |
def generate(): | |
for loc,bot in game.get('robots').items(): | |
if rg.wdist(loc, self.location) <= 1: | |
if player_comparator == None or player_comparator(self.player_id, bot.player_id): | |
yield (loc, bot) | |
return dict(generate()) |
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
@testColor: #ff0000; | |
section#body_content { | |
#grid > .fluid > .row-fluid; | |
h1#body_content_title { | |
#grid > .fluid > .row-fluid; | |
color: @testColor; | |
} | |
/* section#body { | |
#grid > .fluid > .span(8); | |
} |
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
Roadie cannot use "(function( window" when inlining stylesheets | |
Roadie cannot use "undefined )" when inlining stylesheets | |
Roadie cannot use "" when inlining stylesheets | |
Roadie cannot use "// Clean-up method for dom ready events\ndetach = function()" when inlining stylesheets | |
Roadie cannot use ";\njQuery.fn = jQuery.prototype =" when inlining stylesheets | |
Roadie cannot use "return this;\n// HANDLE: $(#id)\nelse" when inlining stylesheets | |
Roadie cannot use "this.context = document;\nthis.selector = selector;\nreturn this;\n// HANDLE: $(expr" when inlining stylesheets | |
Roadie cannot use "$(...))\nelse if ( !context || context.jquery )" when inlining stylesheets | |
Roadie cannot use "// HANDLE: $(DOMElement)\nelse if ( selector.nodeType )" when inlining stylesheets | |
Roadie cannot use "else if ( jQuery.isFunction( selector ) )" when inlining stylesheets |
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
rake aborted! | |
undefined method `tzinfo' for nil:NilClass | |
(in /tmp/build_14qw7djnbp2vr/vendor/bundle/ruby/2.0.0/bundler/gems/detect_timezone_rails-ba752d91669c/vendor/assets/javascripts/jquery.detect_timezone.js.erb) | |
/tmp/build_14qw7djnbp2vr/vendor/bundle/ruby/2.0.0/bundler/gems/detect_timezone_rails-ba752d91669c/vendor/assets/javascripts/jquery.detect_timezone.js.erb:34:in `block in singleton class' | |
/tmp/build_14qw7djnbp2vr/vendor/bundle/ruby/2.0.0/bundler/gems/detect_timezone_rails-ba752d91669c/vendor/assets/javascripts/jquery.detect_timezone.js.erb:-6:in `instance_eval' | |
/tmp/build_14qw7djnbp2vr/vendor/bundle/ruby/2.0.0/bundler/gems/detect_timezone_rails-ba752d91669c/vendor/assets/javascripts/jquery.detect_timezone.js.erb:-6:in `singleton class' | |
/tmp/build_14qw7djnbp2vr/vendor/bundle/ruby/2.0.0/bundler/gems/detect_timezone_rails-ba752d91669c/vendor/assets/javascripts/jquery.detect_timezone.js.erb:-8:in `__tilt_70150981721640' | |
/tmp/build_14qw7djnbp2vr/vendor/bu |
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
# card belongs_to hand and a user | |
# hand belongs_to game | |
# game has_many spaces | |
/hands/:hand_id/cards/:card_id/spaces/:space_id/place?auth_token=TOKEN | |
/cards/:card_id/spaces/:space_id/place?auth_token=TOKEN | |
/cards/:card_id/place?auth_token=TOKEN&space_id=:space_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
# game.rb | |
has_many :hands | |
has_and_belongs_to_many :users | |
embeds_many :spaces | |
# hand.rb | |
belongs_to :user | |
belongs_to :game | |
has_many :cards |
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
#!/usr/bin/ruby | |
# started at 2:29 | |
# 1 | |
test_list = [42, 512, 7, 3, 11] | |
# use builtin summing function | |
expected_value = test_list.reduce(:+) | |
def sum_for(list) |
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 moment = require('moment'); | |
var tz = require('moment-timezone'); | |
var timePlugin = { | |
init: function (client, imports) { | |
return { | |
exports: null, | |
handlers: { | |
'!time': function (message) { | |
var timeNow = moment().tz('America/Chicago').format('ddd, h:mm A'); |
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
function Dijkstra(start, finish, nodes) | |
--Create a closed and open set | |
local open = {} | |
local closed = {} | |
--Attach data to all noded without modifying them | |
local data = {} | |
for _, node in pairs(nodes) do | |
data[node] = { | |
distance = math.huge, |
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
module.exports = function (req, res, next) { | |
res.locals.flash = {}; | |
if(!req.session.flash) return next(); | |
res.locals.flash = _.clone(req.session.flash); | |
req.session.flash = {}; | |
next(); |
NewerOlder