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
from flask import Flask, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
# Expected value | |
ids = [u"one", u"two's", u'"three"'] |
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
$(element).click(function(e) { | |
// Allow the link to act normally when middle-clicking | |
// or clicking with a modifier key | |
if (e.which !== 1 || e.shiftKey || e.ctrlKey || e.altKey) { | |
return true; | |
} | |
// --YOUR 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
# For use within a Flask application using 'app' | |
def static_for(filename, endpoint='.static'): | |
"""Gets the specified static file.""" | |
return url_for(endpoint, filename=filename) | |
app.jinja_env.globals.update(static_for=static_for) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Example of Knockout Trimmed Observables</title> | |
<style> | |
h1 { font-size: x-large; } | |
h2 { font-size: large; } | |
p { margin: 32px; } | |
pre { padding: 32px; } |
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
<!-- Add this within the <body>, just before the first <script> or <%:Html.Script%> element --> | |
<script> | |
console.log('Capturing appendChild()'); | |
var base = document.body; | |
var appendChild = base.appendChild; | |
base.appendChild = function(element) { | |
console.log(element); | |
console.trace(); | |
return appendChild.apply(this, arguments); | |
}; |
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
# Ported from: http://www.gamedev.net/topic/318673-fbo-question/ | |
# | |
# Revised to remove the references to cocos2d | |
import pyglet | |
from pyglet.gl import * | |
from ctypes import c_ulong | |
def init(): | |
# Ported from: http://www.gamedev.net/topic/318673-fbo-question/ |
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:jQuery("p").css("font", "75%/150% 'Verdana'").css("letter-spacing", "0px") |
NewerOlder