Skip to content

Instantly share code, notes, and snippets.

Mark Ragazzo

Block or report user

Report or block Ragazzo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View paxos-made-trivial.js
// Please read the following posts to understand this code:
// - "How Paxos works"
// - "Read write quorums in Paxos"
// - "Best of both worlds: Raft's joint consensus + Single Decree Paxos"
// 1. Leader Election (LE)
vasanthk / System
Last active Dec 8, 2019
System Design Cheatsheet
View System

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
tom-- / Random bytes, ints, UUIDs in
Last active Aug 22, 2019
PHP random bytes, integers and UUIDs
View Random bytes, ints, UUIDs in

Random bytes, ints, UUIDs in PHP

Simple and safe random getters to copy-paste

string randomBytes( int $length )

int randomInt ( int $min , int $max )

string randomUuid ( void )
shreyu86 /
Last active Dec 6, 2019
Route Docker Logs to ELK Stack
  • With Docker 1.8.0 shipped new log-driver for GELF via UDP, this means that the logs from Docker Container(s) can be shipped directly to the ELK stack for further analysis.
  • This tutorial will illustrate how to use the GELF log-driver with Docker engine.
  • Step 1: Setup ELK Stack:
    • docker run -d --name es elasticsearch
    • docker run -d --name logstash --link es:elasticsearch logstash -v /tmp/logstash.conf:/config-dir/logstash.conf logstash logstash -f /config-dir/logstash.conf
    • Note the config for Logstash can be found at this link
    • docker run --link es:elasticsearch -d kibana
  • Once the ELK stack is up now let's fire up our nginx container which ships its logs to ELK stack.
  • LOGSTASH_ADDRESS=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' logstash)
  • `docker run -d --net=host --log-driver=gelf --log-opt gelf-address=u
andrey-yantsen / _bootstrap.php
Created Aug 13, 2013
Correct AspectMock configuration for Yii1
View _bootstrap.php
'debug' => false,
'includePaths' => [
__DIR__ . '/../'
'appDir' => __DIR__ . '/../',
'excludePaths' => [
__DIR__ . '/../config',
__DIR__ . '/../vendor/codeception/aspect-mock',
__DIR__ . '/../runtime',
dypsilon /
Last active Dec 5, 2019
A badass list of frontend development resources I collected over time.
jterrace / xvfb
Created Jun 11, 2012
xvfb init script for Ubuntu
View xvfb
XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset"
case "$1" in
echo -n "Starting virtual X frame buffer: Xvfb"
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
blazarecki / PopupDictionary.php
Last active Aug 15, 2019
Alert, confirm and prompt with mink
View PopupDictionary.php
namespace Widop\Mink\Extension;
* Dictionary to manage popups.
* @author Benjamin Lazarecki <>
trait PopupDictionary
ziadoz /
Last active Nov 5, 2019
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
You can’t perform that action at this time.