Skip to content

Instantly share code, notes, and snippets.

@edgahan
edgahan / protractor-scroll.js
Last active Nov 13, 2015
scrolling protractor
View protractor-scroll.js
# utils.js
module.exports = {
scrollIntoView: function(el) {
browser.executeScript(function(el) {
el.scrollIntoView();
}, el.getWebElement());
}
}
View gist:8b5a869d3d42985233f8
Tzolkin: The Mayan Calendar presents a new game mechanism: dynamic worker placement. Players representing different Mayan tribes place their workers on giant connected gears, and as the gears rotate they take the workers to different action spots.
During a turn, players can either (a) place one or more workers on the lowest visible spot of the gears or (b) pick up one or more workers. When placing workers, they must pay corn, which is used as a currency in the game. When they pick up a worker, they perform certain actions depending on the position of the worker. Actions located "later" on the gears are more valuable, so it's wise to let the time work for you – but players cannot skip their turn; if they have all their workers on the gears, they have to pick some up.
The game ends after one full revolution of the central Tzolkin gear. There are many paths to victory. Pleasing the gods by placing crystal skulls in deep caves or building many temples are just two of those many paths...
@edgahan
edgahan / gist:7023047
Created Oct 17, 2013
Allows angular templates to reload
View gist:7023047
class Sprockets::DirectiveProcessor
# This is basically copied from https://github.com/sstephenson/sprockets/blob/master/lib/sprockets/directive_processor.rb#L289
def process_depend_on_tree_directive(path = ".")
if relative?(path)
root = pathname.dirname.join(path).expand_path
unless (stats = stat(root)) && stats.directory?
raise ArgumentError, "depend_on_tree argument must be a directory"
end