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
# File a.py | |
import sys | |
sys.modules['d'] = __import__("c") | |
sys.modules['e.e'] = __import__("c") | |
import b | |
print b.d # works | |
print b.e.e # ImportError: No module named e.e |
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
# where everything gets installed to | |
# notice that the php.ini directory will be /root/php5/opt/lib and the php.ini won't be autocreated | |
--prefix=/root/php5/opt/ \ | |
# first I disable every module to be as minimal as possible | |
--disable-all \ | |
# required for php-fpm (see my last post) | |
--enable-fpm \ | |
# the new zend opcache (requires php.ini support) | |
--enable-opcache \ | |
# Those are all required for pear |
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
#!/bin/bash | |
./configure \ | |
--prefix=/root/php5/opt/ \ | |
--disable-all \ | |
--enable-fpm \ | |
--enable-opcache \ | |
--enable-xml \ | |
--enable-libxml \ | |
--with-pear \ |
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
from ghost import Ghost | |
from functools import wraps | |
def fix_redirect(func): | |
@wraps(func) | |
def wrapper(self, *args, **kwargs): | |
page, resources = func(self, *args, **kwargs) | |
if resources and 300 <= resources[0].http_status <= 399: | |
nextUrl = resources[0].headers['Location'] | |
page, resources = self.open(nextUrl) |
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 parse(url, html) { | |
var urlLocation = getLocation(url) | |
if (urlLocation.hostname == 'wohnungsmarkt24.de' || urlLocation.hostname == 'www.wohnungsmarkt24.de') | |
return parseWohnungsmarkt24(url, html); | |
else if (urlLocation.hostname == 'immobilienscout24.de' || urlLocation.hostname == 'www.immobilienscout24.de') | |
return parseImmobilienscout24(url, html); | |
else | |
console.log("no parser for this one"); | |
return {}; | |
} |
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
var yql = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent('select * from html where url="' + site + '"') + '&format=xml'; | |
$.ajax({ | |
dataType: "jsonp", | |
url: yql, | |
success: function (data) { | |
... |
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
[client] | |
port = 3306 | |
socket = /var/run/mysqld/mysqld.sock | |
[mysqld_safe] | |
socket = /var/run/mysqld/mysqld.sock | |
nice = 0 | |
[mysqld] | |
user = mysql |
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
user balrok balrok; | |
worker_processes 1; | |
error_log /var/log/nginx/error_log info; | |
events { | |
worker_connections 512; | |
use epoll; | |
} |
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
include "coverage.php"; | |
$reader = new Coverage\Reader('/path/for/output/'); | |
$filter = new Coverage\Filter(); | |
$filter->excludeFileRegex = '/\/yii\/.*\/framework\//'; | |
$merger = new Coverage\Merger(); | |
$converter = new Coverage\Converter(); | |
foreach ($reader as $k=>$data) | |
{ | |
$data = $filter->filterData($data); | |
$merger->mergeData($data); |
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
include coverage.php; | |
$wrapper = new Coverage\Wrapper(); | |
$wrapper->dir = '/path/for/output/'; | |
$wrapper->start(); | |
// here comes your code.. | |
$wrapper->stop(); |
NewerOlder