Skip to content

Instantly share code, notes, and snippets.

View emirb's full-sized avatar

Emir Beganović emirb

  • Booking.com
  • Amsterdam
View GitHub Profile
@emirb
emirb / static-server.go
Last active October 25, 2018 06:34
Simple static file HTTP server in Go
package main
import (
"flag"
"fmt"
"net/http"
"os"
)
type ServerOptions struct {
@emirb
emirb / index.php
Created May 30, 2018 11:58
Symfony front controller with Swoole
<?php
use App\Kernel;
use Symfony\Component\Debug\Debug;
use Symfony\Component\Dotenv\Dotenv;
use Indragunawan\SwooleHttpMessageBridge\Symfony\Request;
use Indragunawan\SwooleHttpMessageBridge\Symfony\Response;
require __DIR__ . '/../vendor/autoload.php';
type Dispatcher struct {
// A pool of workers channels that are registered with the dispatcher
WorkerPool chan chan Job
}
func NewDispatcher(maxWorkers int) *Dispatcher {
pool := make(chan chan Job, maxWorkers)
return &Dispatcher{WorkerPool: pool}
}
@emirb
emirb / keybase.md
Created September 28, 2017 13:32
keybase.md

Keybase proof

I hereby claim:

  • I am emirb on github.
  • I am emirb (https://keybase.io/emirb) on keybase.
  • I have a public key whose fingerprint is 8B59 A1AE 7D34 A24C 1DEE CB30 00F5 64D9 3675 BECA

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am emirb on github.
* I am emirb (https://keybase.io/emirb) on keybase.
* I have a public key ASAOihR0SRjgseKPt26h6DGret4TpyGrDDBxOF3_JWXS6Ao
To claim this, I am signing this object:
#!/bin/sh
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
# Determine if a file list is passed
if [ "$#" -eq 1 ]
then
oIFS=$IFS
IFS='
@emirb
emirb / gist:9106eb2bb50e37cff43ab3479039b327
Last active November 24, 2016 08:32
AWS Spot/Geekbench pricing

Finding the instance size which gives best bang for your buck:

# Name Platform Architecture Single-core Score Multi-core Score Spot per hour Per unit (benchmark/price)
790394 [aws] m4.largeIntel Xeon E5-2686 v4 2300 MHz (1 cores) Linux 64 x86_64 3273 3794 0,01700 223176,4706
790338 [AWS] c4.largeIntel Xeon E5-2666 v3 2900 MHz (1 cores) Linux 64 x86_64 3645 4276 0,02000 213800
790486 [AWS] m4.xlargeIntel Xeon E5-2686 v4 2300 MHz (2 cores) Linux 64 x86_64 3256