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 os | |
from google.appengine.ext import webapp | |
from google.appengine.ext.webapp import template | |
from google.appengine.ext.webapp.util import run_wsgi_app | |
# We extend 'webapp.RequestHandler' to reduce excess code | |
class request(webapp.RequestHandler): | |
# I hate typing, make it shorter | |
def write(self,text): | |
self.response.out.write(text) |
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
''' | |
This program converts all images in a folder to base64 | |
for embedding in an html page inside a <style> tag like: | |
<style> | |
.img_name1{content:url("data:image/jpg;base64,abcdef...");} | |
.img_name2{content:url("data:image/jpg;base64,abcdef...");} | |
</style> | |
The 'content' property only works in webkit browsers. | |
''' |
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
/* dataserver.jss | |
USE: | |
sql = new SQL(); | |
sql.connect(); | |
num = sql.getValue('SELECT count(1) FROM customers') | |
rec = sql.getRecord('SELECT * FROM customers WHERE id=123456') | |
recs = sql.getRecords('SELECT * FROM customers') | |
list = sql.getList('SELECT DISTINCT name FROM customers') | |
table = sql.getTable('SELECT * FROM customers') |
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
/* selectors.js | |
Use: | |
head = $('head') | |
mydiv = $('#mydiv') | |
list = $$('li') | |
*/ | |
function $(selector,element){ |