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 | |
# -*- coding: utf-8 -*- | |
""" Decorating every function in a module """ | |
import types | |
def some_command(): | |
""" This command will knock your socks off! """ | |
print "Hello", |
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
try: | |
from lockfile import LockFile | |
except ImportError: | |
from lockfile import FileLock as LockFile |
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 | |
""" This is a python script for Paul! """ | |
import os | |
for base_dir, sub_dirs, files in os.walk(os.getcwd()): | |
for filename in files: | |
print base_dir + "/" + filename |
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 these imports near the top of the file | |
from sqlalchemy import desc | |
from datetime import datetime, timedelta | |
import random | |
# Add this function OUTSIDE of the RootController | |
def log_message(msg): | |
model.DBSession.add(model.Message(msg=msg)) |
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
# -*- coding: utf-8 -*- | |
"""My Login Modules stuff.""" | |
from sqlalchemy import * | |
from sqlalchemy.orm import mapper, relation | |
from sqlalchemy import Table, ForeignKey, Column | |
from sqlalchemy.types import Integer, Unicode, DateTime | |
#from sqlalchemy.orm import relation, backref | |
from datetime import datetime |
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
(function() { | |
var globals, poll; | |
globals = typeof exports !== "undefined" && exports !== null ? exports : this; | |
globals.polling_interval = 3000; | |
poll = function() { | |
var last, name, toks; | |
toks = window.location.href.split('/'); |
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
<%inherit file="local:templates.master"/> | |
<script type="text/javascript" src="/js/waiting.js"></script> | |
<div id="users" class="running_list"> | |
<h2>Logged in users</h2> | |
<ul> | |
% for user in users: | |
<li>${user['name']}</li> | |
% endfor | |
</ul> |
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
(function() { | |
var act_on_login, check_auth, force_login, globals; | |
globals = typeof exports !== "undefined" && exports !== null ? exports : this; | |
globals.appID = "Your APP Id"; | |
globals.logged_in_callback = function(obj) { | |
console.log(obj); | |
if (obj.error != null) { |
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
(function() { | |
var check_auth, globals; | |
globals = typeof exports !== "undefined" && exports !== null ? exports : this; | |
globals.logged_in_callback = function(user) { | |
return window.location = '/do_login?' + $.param({ | |
name: user.name, | |
access_token: globals.access_token | |
}); |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
${self.meta()} | |
<title>${self.title()}</title> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
% if tmpl_context.in_production: | |
<script type="text/javascript" src="${tg.url('/js/auth-fb.js')}"></script> | |
% else: |