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
{ | |
"name": "Speak Thai", | |
"description": "Reads out selected thai text", | |
"version": "0.1", | |
"permissions": ["contextMenus"], | |
"background": { | |
"scripts": ["speak-thai.js"] | |
}, | |
"manifest_version": 2 |
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
from flask import g, session | |
from google.appengine.api import users | |
class GuestUser(object): | |
def email(self): | |
return None | |
def nickname(self): | |
return 'Guest' |
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
# Compile: coffee -c game.coffee | |
# Run: coffee game.coffee | |
# Dependencies: underscore.js / userscore.coffee and backbone.js | |
# Check if the libs we need are already defined | |
# When running in browser you will need to bundle or add script tags to include these libs | |
if not _? | |
require('underscore') | |
if Backbone? |
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
var noop = function(){}; | |
var console = window['console'] || {log: noop, debug: noop, info: noop, warn: noop, error: function(args){alert(args);}}; | |
var loadScriptTag = function(src, loaded, callback) { | |
if(loaded()){ | |
callback(); | |
return; | |
} | |
console.log("Loading missing javascript.", "swfobject", src); | |
var scriptTag=document.createElement('scr'+'ipt'); | |
scriptTag.type = 'text/javascript'; |
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
New house/office warming and codegent's 6th birthday party. | |
When: | |
Friday April 30th, 7PM until late. | |
Where: | |
95 Sena Nikom 1 Soi 23, Pahon-yotin 32 Road, Ladprao, Bangkok 10230 |
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 PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>index</title> | |
<link rel="stylesheet" href="style.css" type="text/css" media="screen" /> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> | |
<script type="text/javascript" src="mustache.js"></script> | |
<script type="text/javascript" src="app.js"></script> |
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
class App(object): | |
def __init__(id, name, | |
default=False, selected=False, groups=['misc'], | |
description="", icon="app-icons_default.png"): | |
self._id = id | |
self._name = name | |
self._groups = groups | |
self._default = default | |
self._selected = selected |
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
import gaerun | |
from google.appengine.ext import db | |
class LazyModelMixin: | |
@classmethod | |
def get_put_by_key_name(cls, key_name, **kwargs): | |
object = cls.get_by_key_name(key_name) or cls(key_name=key_name, **kwargs) | |
if object.is_saved: |
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
# -*- coding: utf-8 -*- | |
# WARNING: THIS CODE MAY HURT YOUR EYES. | |
import logging, os | |
def patch_mako(): | |
import os, logging | |
from mako import template as template_module | |
from mako.lookup import TemplateLookup |
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
""" dump any string to formatted hex output """ | |
def dump(s): | |
import types | |
if type(s) == types.StringType: | |
return dumpString(s) | |
elif type(s) == types.UnicodeType: | |
return dumpUnicodeString(s) | |
FILTER = ''.join([(len(repr(chr(x))) == 3) and chr(x) or '.' for x in range(256)]) |
NewerOlder