Skip to content

Instantly share code, notes, and snippets.

<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;});
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 += '>';
}
@arrix
arrix / html_entity_innerHTML_test.js
Created November 12, 2010 09:26
Tests whether an html entity is allowed in .innerHTML assignment
// 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 &quot;, &amp;, &lt; and &gt; work.
var markupEntities = ["&quot;", "&amp;", "&lt;", "&gt;", "&OElig;", "&oelig;", "&Scaron;", "&scaron;", "&Yuml;", "&circ;", "&tilde;", "&ensp;", "&emsp;", "&thinsp;", "&zwnj;", "&zwj;", "&lrm;", "&rlm;", "&ndash;", "&mdash;", "&lsquo;", "&rsquo;", "&sbquo;", "&ldquo;", "&rdquo;", "&bdquo;", "&dagger;", "&Dagger;", "&permil;", "&lsaquo;", "&rsaquo;", "&euro;"];
var iso8859_1Entities = ["&nbsp;", "&cent;", "&pound;", "&curren;", "&yen;", "&brvbar;", "&sect;", "&uml;", "&copy;", "&ordf;", "&laquo;", "&not;", "&shy;", "&reg;", "&macr;", "&deg;", "&plusmn;", "&sup2;", "&sup3;", "&acute;", "&micro;", "&para;", "&middot;"
@arrix
arrix / diigo.js
Created April 27, 2011 13:12
Cryptic javascript
//only works in google chrome
($=[$=[]][(__=!$+$)[_=-~-~-~$]+({}+$)[_/_]+($$=($_=!''+$)[_/_]+$_[+$])])()[__[_/_]+__[_+~$]+$_[_]+$$](($=[$=[]][$]+$)[_=-~-~$]+[$_=$[__=-~-~-~_]]+$_+($[($__=[$_=[{}+[]]+[]][+[]][__])+$_[-~+[]]+$[-~-[]]+(!$+[])[__-_]+($$=!+[]+$)[+!$]+$$[-~[]]+$$[_]+$__+$$[-[]]+({}+[])[-~+[]]+$$[~-_]]+$)[~-__+__+__]+({}+[])[-~+[]])
//the above no longer works in recent versions. I had to introduce an extra comma.
($=[$=[]][(__=!$+$)[_=-~-~-~$]+({}+$)[_/_]+($$=($_=!''+$)[_/_]+$_[+$])]),$()[__[_/_]+__[_+~$]+$_[_]+$$](($=[$=[]][$]+$)[_=-~-~$]+[$_=$[__=-~-~-~_]]+$_+($[($__=[$_=[{}+[]]+[]][+[]][__])+$_[-~+[]]+$[-~-[]]+(!$+[])[__-_]+($$=!+[]+$)[+!$]+$$[-~[]]+$$[_]+$__+$$[-[]]+({}+[])[-~+[]]+$$[~-_]]+$)[~-__+__+__]+({}+[])[-~+[]])
@arrix
arrix / gpipe.py
Created March 9, 2012 04:07
Chains a series of generator functions using unix command line pipe like syntax
# 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
"""