This file contains 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
#!/usr/bin/env python | |
from google.appengine.ext import webapp | |
from google.appengine.ext.webapp import util | |
import urllib2 | |
import os | |
class MainHandler (webapp.RequestHandler): | |
def get (self): | |
# Set the cross origin resource sharing header to allow AJAX |
This file contains 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
/** | |
* app.js -- bootstrap so we can test different things ourselves | |
*/ | |
var PRODUCTION_HOST = '//your-production-host.appspot.com', | |
DEVELOPMENT_HOST = 'localhost', | |
DEVELOPMENT_PORT = '8001'; | |
var views = [ | |
"test", |
This file contains 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 type="text/javascript"> | |
Bootstrap.javascript("/assets/javascripts/test.js"); | |
</script> | |
<br> | |
<input type="text" id="message"> <input type="button" value="Send!" id="send"/> | |
<br> | |
Received: <span id="receive"></span> | |
<br> |
This file contains 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 state changes and message passing | |
var StateTest = { | |
'_pingTime': 0, | |
'init': function(){ | |
$("#message").keydown(StateTest.send); | |
$("#send").click(function(){ | |
StateTest.send({'keyCode': 13}); | |
}); |
This file contains 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
// beautiful.. http://www.leemon.com/crypto/MakePass.html | |
// this is the html-entity-encoded onchange event | |
// decoded with http://www.strictly-software.com/htmlencoder | |
//XOR the current time and last key pressed into the entropy pool, and hash it | |
fingerprint[0] ^= (t.z.value=='' || t.z.value==null || t.z.length==0) ? 0 : t.z.value.charCodeAt(t.z.value.length-1); | |
fingerprint[1] ^= (new Date()).getTime(); | |
fingerprint[2] ^= nBits; | |
fingerprint[3] ^= nPass; | |
//t.z.value=hexFingerprint(); |
This file contains 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
javascript:(function(){ | |
var az = document.getElementsByTagName("a"); | |
for (var i in az) { | |
az[i].innerHTML = "<img src='" + az[i].href + "'>"; | |
} | |
})() |
This file contains 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
javascript:(function () { | |
function getTextNodesIn(node, includeWhitespaceNodes) { | |
var textNodes = [], whitespace = /^\s*$/; | |
function getTextNodes(node) { | |
if (node.nodeType == 3) { | |
if (includeWhitespaceNodes || !whitespace.test(node.nodeValue)) { | |
textNodes.push(node); | |
} | |
} else { | |
for (var i = 0, len = node.childNodes.length; i < len; ++i) { |
This file contains 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>$($("code").each(function(){ $(this).html( $(this).html().replace(/</g,"<") ) }))</script> | |
<code> | |
<i>i buy water</i> | |
</code> |
This file contains 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
<style> | |
.short { display: block; } | |
.short .more { font-weight: bold; cursor: pointer; } | |
.long { display: none; } | |
.long .less { font-weight: bold; cursor: pointer; } | |
</style> | |
{{#events}} | |
<p>{{name}}</p> | |
<span class="description"> |
This file contains 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
javascript:(function(){var az = document.getElementsByTagName("a"); for (var i in az) { az[i].innerHTML = "<img src='" + az[i].href + "'>"; } })() |
OlderNewer