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
~ % erl -myflag 1 | |
Erlang R15B02 (erts-5.9.2) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false] | |
Eshell V5.9.2 (abort with ^G) | |
1> init:get_argument(myflag) | |
1> q() | |
1> dsahldkj ahsdasd;asldja ddas | |
1> |
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
package Mail::RFC822::Address; | |
use strict; | |
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); | |
require Exporter; | |
@ISA = qw(Exporter); | |
# Items to export into callers namespace by default. Note: do not export |
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 inspect import getmembers, getargspec, ismethod | |
from functools import wraps | |
from decorator import decorator | |
# Some super basic decorators | |
def std_decorator(f): | |
def std_wrapper(*args, **kwargs): | |
return f(*args, **kwargs) | |
return std_wrapper |
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 inspect import getmembers, getargspec, ismethod | |
from functools import wraps | |
from decorator import decorator | |
# Some super basic decorators | |
def std_decorator(f): | |
def std_wrapper(*args, **kwargs): | |
return f(*args, **kwargs) | |
return std_wrapper |
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
"CookieClickerGame=MS4wMzZ8fDEzODAwMDYyMTYwODd8MTExMTExfDEzNDgwOTg5MDszOTY4MDMyNjI7MTY2NTsyOzI1MzA1MTsxMjstMTstMTswOzA7MDswOzA7MHwwLDEyMSwxNzgyOSwwOzAsMTMsNTk1NCwwOzAsOSwxMzk4OCwwOzAsNDgsMTUyMzA1LDA7MCw1LDI3Nzg5OSwwOzAsOCwxMjQxNDgzLDA7MCwyMCwzMjI2NDEzLDA7MTQsMTQsMzA0NDU4MzEzLDA7MTUsMTUsNDg4MDk2NjIsMDsyMCwyMCwwLDA7fDI5OTM0Njc1MjgyMTkzOTE7MjI1MTgwMjE0MDE0MDIwNzsyMjUxNzk5ODEzNjg1MjQ5OzIyNTE3OTk4MTM2ODUyNzk7NTI0Mjg5fDM1Mzk1NzQ4OTg2ODg1MTE7ODc5NjEwMTY3NzY0MQo=%21END%21; __utma=26628008.63387758.1380213262.1380213262.1380213262.1; __utmb=26628008.3.10.1380213262; __utmc=26628008; __utmz=26628008.1380213262.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __cfduid=da7f74d1af9d9de659fbeace4f84014951380213255852" |
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
@app.teardown_request | |
def shutdown_request(exc=None): | |
if exc is not None: | |
print "An exception happened!" | |
def test_request_teardown(self): | |
try: | |
with self.app.test_request_context(): | |
raise Exception('dummy exception') | |
except: |
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
rom flask import Flask | |
app = Flask(__name__) | |
@app.teardown_request | |
def teardown(exc = None): | |
if exc is not None: | |
print "An exception has occured!" | |
try: |
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 TestContext(object): | |
def __init__(self): | |
self.entered = False | |
self.exited = False | |
def __enter__(self): | |
self.entered = True | |
def __exit__(self): | |
self.exited = True |
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 sys | |
class TestContext(object): | |
def __init__(self): | |
self.entered = False | |
self.exited = False | |
def __enter__(self): | |
self.entered = True | |
def __exit__(self, exc_type, exc_value, tb): | |
self.exited = True |
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 Flask, request, jsonify | |
from flask.ext.wtf import Form, TextField, Email | |
from flask.ext.babel import get_translations, lazy_gettext as __ | |
from flask.json import JSONEncoder | |
from speaklater import make_lazy_string, is_lazy_string | |
class CustomTranslations(object): | |
def babel_gettext(self, s): | |
return get_translations().ugettext(s) |
OlderNewer