Skip to content

Instantly share code, notes, and snippets.

View farazdagi's full-sized avatar

Victor Farazdagi farazdagi

View GitHub Profile
@rauljordan
rauljordan / Multinode.md
Last active April 7, 2020 16:12
Multinode setup mainnet for Prysm

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:

@farazdagi
farazdagi / distributed-systems-reasources.md
Last active August 29, 2015 14:12
Distributed Systems: Amazing Resources

Distributed Systems: Amazing Resources

A list of amazing resources related to Distributed Systems.

Projects

Some noteworthy projects.

@adharris
adharris / postgres_array.go
Created November 28, 2012 19:52
PostgreSQL demo of Array types using Golang
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"
@hjr3
hjr3 / nginx.conf
Created September 23, 2012 17:58
nginx phpfpm + CORS configuration
upstream phpfpm {
server 127.0.0.1:9000;
}
server {
listen 80;
server_name _;
root /var/www/html;
index index.php;
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@emre
emre / flask_mongodb_json_tools.py
Created May 27, 2011 14:49
mongodb, flask, better than jsonify
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')
@ryanb
ryanb / github_tree_slider.js
Created December 6, 2010 17:23
This is how GitHub's new AJAX file browser works.
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)/)) {
@raphaelstolt
raphaelstolt / pre-commit
Created September 20, 2010 21:35
A pre-commit for running PHPUnit
#!/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);
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)