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 is a namespace package | |
try: | |
import pkg_resources | |
pkg_resources.declare_namespace(__name__) | |
except ImportError: | |
import pkgutil | |
__path__ = pkgutil.extend_path(__path__, __name__) |
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
<?php | |
class toto | |
{ | |
public function __construct() | |
{ | |
$this->method = function () { | |
echo 'it works'; | |
}; | |
} |
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 subprocess | |
from flask import Flask | |
from hamlpy import hamlpy | |
def sass(source): | |
proc = subprocess.Popen(['/var/lib/gems/1.8/gems/sass-3.1.7/bin/sass'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) | |
return proc.communicate(source)[0] | |
def scss(source): | |
proc = subprocess.Popen(['/var/lib/gems/1.8/gems/sass-3.1.7/bin/scss'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) |
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
""" | |
Welcome to "what better thing to do than coding a web app while drinking my | |
morning coffee"-framework. | |
It show how easy it is to code a standalone/state-of-the-art mini web application | |
using python, and some amazing libraries available around. | |
Disclaimer | |
---------- |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDdQb/snQNzh66f2MM8o9enWBtVMotcJuEczVcGi8StEVqeJWlZ31q0cd6ATwXzvDupvqU4Y5J7zf1jCkRqhs3a/eBQ1znuV/62OUyxwi1Ezmt+e0YlBOxxgYPTen7KSA23a9vjCSICpI9NlOW9SymkHrdVBIbtN0OgTWpHWTNaapUud5wmrrvCO5A+sJVFXC6bL2Sfffl6seV3FNJLn+LZcIT56iWmKJExoq4MUnCNRf1K8Qe/4z5tyS4rqODdsmzbZ0X17QhewnN7ZUc044BJ+hxZbaebK0bF/yzbXi/dHDvr8dYTwRgN5IChEAdUJR2yU/n/+GCbtk6GGG28BIEh |
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
# Decorate manually with this. | |
def fixparams(decorated, **fixed): | |
def _fixparams(*args, **kwargs): | |
kwargs.update(fixed) | |
return decorated(*args, **kwargs) | |
return _fixparams | |
# old school / inline syntax | |
def myfunc(a, b, c): | |
print '%s %s %s' % (a, b, c) |
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 getXMLHttpRequest() { | |
var xhr = null; | |
if (window.XMLHttpRequest || window.ActiveXObject) { | |
if (window.ActiveXObject) { | |
try { | |
xhr = new ActiveXObject("Msxml2.XMLHTTP"); | |
} catch(e) { | |
xhr = new ActiveXObject("Microsoft.XMLHTTP"); | |
} |
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
>>> def b(test={}): | |
... print test | |
... test['foo'] = 'bar' | |
... | |
>>> b() | |
{} | |
>>> b() | |
{'foo': 'bar'} |
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.handlers | |
import smtplib | |
class BufferingSMTPHandler(logging.handlers.BufferingHandler): | |
def __init__(self, mailhost, fromaddr, toaddrs, subject, capacity): | |
logging.handlers.BufferingHandler.__init__(self, capacity) | |
self.mailhost = mailhost | |
self.mailport = None | |
self.fromaddr = fromaddr | |
if isinstance(toaddrs, (str, unicode)): |
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
#29492 0x0833db07 in zend_do_fcall_common_helper_SPEC (execute_data=0xbf8623f4) at /home/sensio/dev/.c/php/source/php-5.2.11/Zend/zend_vm_execute.h:200 | |
#29493 0x0834334a in ZEND_DO_FCALL_SPEC_CONST_HANDLER (execute_data=0xbf8623f4) at /home/sensio/dev/.c/php/source/php-5.2.11/Zend/zend_vm_execute.h:1739 | |
#29494 0x0833d676 in execute (op_array=0x86644f0) at /home/sensio/dev/.c/php/source/php-5.2.11/Zend/zend_vm_execute.h:92 | |
#29495 0x0830b3ab in zend_call_function (fci=0xbf8625b8, fci_cache=0xbf8625dc) at /home/sensio/dev/.c/php/source/php-5.2.11/Zend/zend_execute_API.c:1038 | |
#29496 0x0832fcd5 in zend_call_method (object_pp=0x867f3f8, obj_ce=0x866f214, fn_proxy=0x867f3f4, function_name=0x863e4dc "sfautoloadagain::autoload\v", function_name_len=30, retv | |
al_ptr_ptr=0xbf862690, param_count=1, arg1=0x8b3b418, arg2=0x0) at /home/sensio/dev/.c/php/source/php-5.2.11/Zend/zend_interfaces.c:88 | |
#29497 0x081acf9d in zif_spl_autoload_call (ht=1, return_value=0x8b3e33c, return_value_ptr=0x0, this_ptr=0x0, return_value_used=0) |