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
Feature: Anaphora | |
Scenario: Dog barks at cat | |
Given there is a dog | |
And there is a cat | |
When the dog barks at the cat | |
Then the cat should run away |
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 - single global variable for all news JS | |
var news = news || {}; | |
// Example of a singleton as a revealing module | |
// When you only need one of something | |
news.preferences = (function (app, global) { | |
// Private variables | |
var persistent = true; |
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
Sprint 2 | |
Evaluate unit test framework options (some are unlikely to work on all devices) | |
Make unit tests run under node.js and in-browser | |
Make unit tests run in headless browser in hudson (when code is committed) | |
Sprint 3 | |
Make spassky tool (runs tests on physical devices) usable by dev team | |
Improve spassky output: summarise passes/fails/devices and stack traces | |
Sprint 4 |
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
function EbnfDiagram(gc) { | |
this.gc = gc; | |
this.styles = STYLES; | |
this.style = this.styles["DIAGRAM"]; | |
this.init(); | |
} | |
EbnfDiagram.prototype.getGC = function() { | |
return this.gc; |
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
async = require 'async' | |
one ! = 1 | |
two ! = 2 | |
plus ! (x, y) = x + y | |
log ! (x) = console.log (x) | |
concat (memo, item, callback) = | |
done = @(err, result) | |
callback (err, memo.concat(result)) |
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
# capybara '1.1.2 | |
require 'capybara' | |
require 'capybara/dsl' | |
require 'capybara/mechanize' | |
Capybara.default_driver = :mechanize | |
Capybara.app_host = 'http://httpbin.org' | |
include Capybara::DSL |
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
-- a little flame in a functional style | |
function particle(step, style, t) | |
local newStyle = step(style, t) | |
return { | |
style = newStyle, | |
next = function() | |
return particle(step, newStyle, t + 1) | |
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
echo | |
echo "DELETE INDEX" | |
echo | |
curl -w "\r\n" -X DELETE http://localhost:9200/temp-index | |
echo | |
echo "CREATE MAPPINGS" | |
echo | |
curl -w "\r\n" -X POST http://localhost:9200/temp-index -d '{"mappings":{"product":{"properties":{"name":{"type":"string","analyzer":"snowball"},"tags":{"type":"string","index":"not_analyzed"},"url":{"type":"string","index":"not_analyzed"},"image":{"type":"string","index":"not_analyzed"},"class":{"type":"string","index":"not_analyzed"},"publisher":{"type":"string","index":"not_analyzed"}}}},"settings":{}}' |
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 'nokogiri' | |
Nokogiri::HTML('<z><a /><b /><a /><b /><b /><b /><a /><c><a /><b /></c></z>').css("a + b") | |
=> [#<Nokogiri::XML::Element:0x3fdf7d0c0a34 name="b">, #<Nokogiri::XML::Element:0x3fdf7d0c0688 name="b">, #<Nokogiri::XML::Element:0x3fdf7d0c046c name="b">] | |
Nokogiri::HTML('<z><a /><b /><a /><b /><b /><b /><a /><c><a /><b /></c></z>').xpath("//a/following-sibling::*[1]/self::b") | |
=> [#<Nokogiri::XML::Element:0x3fdf7d0cc294 name="b">, #<Nokogiri::XML::Element:0x3fdf7d0cc08c name="b">, #<Nokogiri::XML::Element:0x3fdf7d0cbe70 name="b">] | |
$('<z><a /><b /><a /><b /><b /><b /><a /><c><a /><b /></c></z>').find('a + b'); | |
Object[b, b, b] |
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
import minecraft | |
import block | |
import time | |
mc = minecraft.Minecraft.create() | |
direction = 'none' | |
playerTilePos = mc.player.getTilePos() | |
mc.setBlocks(playerTilePos.x - 25, playerTilePos.y, playerTilePos.z - 25, playerTilePos.x + 25, playerTilePos.y + 2, playerTilePos.z + 25, block.AIR) |