Skip to content

Instantly share code, notes, and snippets.

@cdata
cdata / docwritehell
Created September 1, 2011 21:16
Document.write Hell
dominate.js:1054[ DJS ] Buffering document.write content: <div id="apps_9651" style="">
dominate.js:1054[ DJS ] Parsing document.write content: <div id="apps_9651" style="">
dominate.js:1054[ DJS ] Buffering document.write content: <STYLE>
dominate.js:1054[ DJS ] Parsing document.write content: <STYLE>
dominate.js:1054[ DJS ] Buffering document.write content: .Text407873337152778 { font-family:Verdana,Arial !important; font-size:8pt !important;color:#000000 }
dominate.js:1054[ DJS ] Parsing document.write content: .Text407873337152778 { font-family:Verdana,Arial !important; font-size:8pt !important;color:#000000 }
dominate.js:1054[ DJS ] Buffering document.write content: .Text407873337152778 span { color:#000000 !important; }
dominate.js:1054[ DJS ] Parsing document.write content: .Text407873337152778 span { color:#000000 !important; }
dominate.js:1054[ DJS ] Buffering document.write content: .Comment407873337152778
dominate.js:1054[ DJS ] Parsing document.write content: .Comment407873337152778
@cdata
cdata / globaleval.js
Created September 8, 2011 01:42
Global Eval for IE < 8
window.foo = 1;
(function bar() {
var foo = 2;
function exec(code) {
var scr = document.createElement("script");
@cdata
cdata / tracking.json
Created September 22, 2011 19:16
Tracking Data Format
[
{
"ts" : 1316718251979,
"op" : "outboundclick",
"page" : "http://www.example.com/foo/bar.html",
"kvs" : {
"href" : "http://www.google.com/",
"text" : "Check out Google!"
}
},
@cdata
cdata / snaptest.js
Created September 30, 2011 23:22
SnapEngage Test
var SnapABug = function() {
var c = document.location.protocol == "https:" ? "https://snapabug.appspot.com" : "http://www.snapengage.com",
g = document.location.protocol == "https:" ? "https://chtatic.appspot.com" : "http://chtatic.appspot.com",
l = !0,
e = !0,
k = !1,
a = "",
t = "",
p = "",
m = "",
@cdata
cdata / fun.js
Created October 18, 2011 05:32
Cross-browser JavaScript Fun
window.console = window.console || { log: function() {} };
window.foo = undefined;
window.bar = undefined;
var foo = (function() {
function bar() {
console.log('foo');
}
@cdata
cdata / twilight-imperium-tech-tree.json
Created October 27, 2011 15:24
Twilight Imperium Tech Tree in JSON
{
"Antimass Deflectors" : {
"text" : "All of your ships may now move through Asteroid Fields but may never end their movement in an Asteroid Field.",
"type" : "fleet"
},
"Gravity Drive" : {
"text" : "You do not need to roll to leave a gravity rift; if adjacent to a gravity rift or wormhole, +1 to movement.",
"type" : "fleet",
"required" : [
"Antimass Deflectors"
@cdata
cdata / image.html
Created December 1, 2011 22:10
Dynamic Image Tag Format
<img data-cfsrc="foo.png" data-cfstyle="original:style;" style="display:none;" />
<noscript>
<img src="foo.png" style="original:style;" />
</noscript>
<!-- time passes.. -->
<script type="text/javascript">
//<![CDATA[
setTimeout(
@cdata
cdata / cloudflare.json
Created February 10, 2012 21:42
Example cloudflare.json format for CloudFlare Apps
{
"name": "Stop Censorship",
"description": "Together we will make the bad guys regret their badness.",
"keywords" : [
"anti-censorship"
],
"version": "0.0.1",
"contributors": [
{
"name" : "Michael Sofaer",
@cdata
cdata / install-damonbot.sh
Created February 18, 2012 23:49
Damonbot Installation Script
#!/bin/bash
echo "This script will attempt to install Damonbot.";
echo "Node and npm are required dependencies. Make sure you install them first.";
directory=$1
if ! [ "$directory" ]; then
echo "Please specify the directory where Damonbot should be installed.";
exit 1;
@cdata
cdata / inline-wrapper.js
Created February 22, 2012 02:20
Inline-handler Wrapper Syntax
(function(context) {
window.CloudFlare && window.CloudFlare.push(
function(require) {
require(
['cloudflare/rocket'],
function(rocket) {
rocket.push(
function() {