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
# Python is great for sysadmin. | |
# Generators are great for plumbing. | |
# Nesting generator function calls is messy. | |
# (i for i in GPipe(inital)|func1|func2|(func3, args..)) | |
class GPipe: | |
"""Connects a chain of generators | |
""" |
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
//only works in google chrome | |
($=[$=[]][(__=!$+$)[_=-~-~-~$]+({}+$)[_/_]+($$=($_=!''+$)[_/_]+$_[+$])])()[__[_/_]+__[_+~$]+$_[_]+$$](($=[$=[]][$]+$)[_=-~-~$]+[$_=$[__=-~-~-~_]]+$_+($[($__=[$_=[{}+[]]+[]][+[]][__])+$_[-~+[]]+$[-~-[]]+(!$+[])[__-_]+($$=!+[]+$)[+!$]+$$[-~[]]+$$[_]+$__+$$[-[]]+({}+[])[-~+[]]+$$[~-_]]+$)[~-__+__+__]+({}+[])[-~+[]]) | |
//the above no longer works in recent versions. I had to introduce an extra comma. | |
($=[$=[]][(__=!$+$)[_=-~-~-~$]+({}+$)[_/_]+($$=($_=!''+$)[_/_]+$_[+$])]),$()[__[_/_]+__[_+~$]+$_[_]+$$](($=[$=[]][$]+$)[_=-~-~$]+[$_=$[__=-~-~-~_]]+$_+($[($__=[$_=[{}+[]]+[]][+[]][__])+$_[-~+[]]+$[-~-[]]+(!$+[])[__-_]+($$=!+[]+$)[+!$]+$$[-~[]]+$$[_]+$__+$$[-[]]+({}+[])[-~+[]]+$$[~-_]]+$)[~-__+__+__]+({}+[])[-~+[]]) |
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
// Tests whether an html entity is allowed in .innerHTML assignment for xhtml documents. | |
// entities scraped from http://www.webstandards.org/learn/reference/charts/entities/ | |
// stack overflow question on this issue http://stackoverflow.com/questions/4162270/why-does-this-simple-innerhtml-assignment-throw-an-exception/ | |
// In my testing, in Webkit and Mozilla, only ", &, < and > work. | |
var markupEntities = [""", "&", "<", ">", "Œ", "œ", "Š", "š", "Ÿ", "ˆ", "˜", " ", " ", " ", "‌", "‍", "‎", "‏", "–", "—", "‘", "’", "‚", "“", "”", "„", "†", "‡", "‰", "‹", "›", "€"]; | |
var iso8859_1Entities = [" ", "¢", "£", "¤", "¥", "¦", "§", "¨", "©", "ª", "«", "¬", "­", "®", "¯", "°", "±", "²", "³", "´", "µ", "¶", "·" |
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 getHTMLSource() { | |
var doc = document; | |
var dt = document.doctype; | |
var dtSource = ""; | |
if (dt) { | |
dtSource = '<!DOCTYPE html PUBLIC'; | |
if (dt.publicId) dtSource += (' "' + dt.publicId + '"'); | |
if (dt.systemId) dtSource += (' "' + dt.systemId + '"'); | |
dtSource += '>'; | |
} |
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
<doctype html> | |
<html> | |
<head></head> | |
<body> | |
<p>Most bizzare JavaScript bug in Opera 10.62 build 8437 (Mac OS X 10.6.4). Observable only without Dragonfly. Open error console to see the output.</p> | |
<script type="text/javascript"> | |
(function () { | |
var list = Array(50).join(' ').split('').map(function(n){return 1;}); |