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
<script> | |
window.addEventListener("message", receiveMessage, false); | |
function receiveMessage(event) | |
{ | |
alert("RECEIVED!"); | |
if (event.origin !== "http://localhost:3000") | |
return; |
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
<html> | |
<body> | |
<h1 id="heading"></h1> | |
<iframe id="frame" src="about:blank" style="width: 100%; height: 100%"></iframe> | |
<script type="text/javascript"> | |
var urls = [ | |
'http://httpbin.org/status/418', |
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
git checkout master | |
git pull origin master | |
[run tests] | |
[write failing test] | |
[make test pass] | |
git checkout -b feature_x | |
git add . | |
git commit -m "Feature X" | |
[refactor] | |
[run tests] |
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
get-childitem . -include *.csproj -rec | select-string -pattern "<HintPath>[^<]+</HintPath>" | % { $_ -replace '</?HintPath>',"" } | % { write-host $_; $_ } | % { $_ -replace '[^\\]*.csproj:\d+:',"" } | % { $_ -replace '\s+','' } | % { resolve-path $_ } |
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
module.exports = { | |
render () = | |
div ( | |
h1 { id = 'main_heading' } (props.heading) | |
p (props.introduction) | |
) | |
} |
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) |
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
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
-- 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
# 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 |