Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
from json import JSONEncoder | |
from pymongo.objectid import ObjectId | |
class MongoEncoder(JSONEncoder): | |
def _iterencode(self, o, markers=None): | |
if isinstance(o, ObjectId): | |
return """ObjectId("%s")""" % str(o) | |
else: | |
return JSONEncoder._iterencode(self, o, markers) |
#!/usr/bin/php | |
<?php | |
printf("%sGit pre-commit hook %1\$s", PHP_EOL); | |
$projectName = basename(getcwd()); | |
exec('phpunit --configuration phpunit.xml', $output, $returnCode); // Assuming cwd here | |
if ($returnCode !== 0) { | |
$minimalTestSummary = array_pop($output); | |
printf("Test suite for %s failed: ", $projectName); | |
printf("( %s ) %s%2\$s", $minimalTestSummary, PHP_EOL); | |
return false; // exit(1); |
GitHub.TreeSlider = function () { | |
if (window.history && window.history.pushState) { | |
function a() { | |
if (e.sliding) { | |
e.sliding = false; | |
$(".frame-right").hide(); | |
$(".frame-loading:visible").removeClass("frame-loading") | |
} | |
} | |
if (!($("#slider").length == 0 || !GitHub.shouldSlide)) if (!navigator.userAgent.match(/(iPod|iPhone|iPad)/)) { |
class MongoEncoder(json.JSONEncoder): | |
def _iterencode(self, o, markers=None): | |
if isinstance(o, ObjectId): | |
return str(o) | |
else: | |
return json.JSONEncoder._iterencode(self, o, markers) | |
def smart_json_response(data): | |
data = json.dumps(data, cls = MongoEncoder, indent=4) | |
return current_app.response_class(data, mimetype='application/json') |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
upstream phpfpm { | |
server 127.0.0.1:9000; | |
} | |
server { | |
listen 80; | |
server_name _; | |
root /var/www/html; | |
index index.php; |
package main | |
import ( | |
"database/sql" | |
"errors" | |
"fmt" | |
_ "github.com/bmizerany/pq" | |
"os" | |
"regexp" | |
"strings" |
A list of amazing resources related to Distributed Systems.
Some noteworthy projects.
Hi all, to try out a multinode setup with interop config:
bazel run //tools/genesis-state-gen --define=ssz=mainnet -- \
--num-validators=64 \
--output-ssz=/tmp/genesis.ssz \
--mainnet-config
First node: