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 logging | |
from pylons import config, request, response, session, tmpl_context as c | |
from pylons.controllers.util import abort, redirect_to, url_for | |
from pylons_openid.lib.base import BaseController, render | |
log = logging.getLogger(__name__) | |
import urllib2 | |
import md5 | |
import simplejson as json_ |
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
$(function() { | |
//run the accordion plugin, set height of sections to height of content | |
$("#accordion").accordion({ autoHeight: false }); | |
}); | |
;(function($) { | |
//write new sammy application | |
var app = new Sammy.Application(function() { | |
with(this) { | |
//corresponds to routes such as #/section/1 | |
get('#/section/:section_id', function() { with(this) { |
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
// adds a persitant server-side logger to the Sammy logger pool | |
Sammy.addLogger(function() { | |
var message = $.makeArray(arguments).join(', '); | |
// dont provide a callback (aka ignore the results) | |
$.post('/log', "message=" + message); | |
}); | |
Sammy.log('logging', 'should', 'be', 'working'); | |
// POST /log |
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
#!/usr/bin/env python | |
""" | |
urlnorm.py - URL normalisation routines | |
urlnorm normalises a URL by; | |
* lowercasing the scheme and hostname | |
* taking out default port if present (e.g., http://www.foo.com:80/) | |
* collapsing the path (./, ../, etc) | |
* removing the last character in the hostname if it is '.' |
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
-- select size of tables and indices in random order | |
SELECT relname, reltuples, relpages FROM pg_class ; | |
-- select size of tables and indices in descending order of size | |
SELECT relname, reltuples, relpages FROM pg_class ORDER BY relpages DESC ; | |
-- select size of tables and indices in descending order of tuple- / recordcount | |
SELECT relname, reltuples, relpages FROM pg_class ORDER BY reltuples DESC ; | |
-- Change admin password |
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
# Copyright (c) 2010, Philip Plante of EndlessPaths.com | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in |
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
* Review this article and add new steps as needed: http://blog.therubymug.com/blog/2010/05/20/the-install-osx.html |
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
# offset | |
regexp=([0-9a-fA-F]{1,7})+ | |
colours=bold red | |
count=once | |
====== | |
# Hex Bytes %_p | |
regexp=\|.+?\| | |
colours=cyan | |
count=once | |
====== |
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
alpha2 | alpha3 | numeric | name | |
---|---|---|---|---|
AF | AFG | 004 | Afghanistan | |
AX | ALA | 248 | Åland Islands | |
AL | ALB | 008 | Albania | |
DZ | DZA | 012 | Algeria | |
AS | ASM | 016 | American Samoa | |
AD | AND | 020 | Andorra | |
AO | AGO | 024 | Angola | |
AI | AIA | 660 | Anguilla | |
AQ | ATA | 010 | Antarctica |
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 tornado.ioloop import IOLoop | |
# Calls fn for all items of iterable, saves result to a list, and | |
# calls callback with that list. This is most useful when fn works | |
# asynchronously. | |
def async_map(fn, iterable, callback, io_loop=None): | |
ioloop = io_loop or IOLoop.instance() | |
def loop(): | |
try: |
OlderNewer