Skip to content

Instantly share code, notes, and snippets.

@slax0rr
slax0rr / gist:9684509
Created March 21, 2014 11:48
Javascript object
{"100":[1000,500,100],"50":[500,100,50],"10":[100,50,10],"1000":[10000,5000,1000]}

Keybase proof

I hereby claim:

  • I am slax0rr on github.
  • I am slax0r (https://keybase.io/slax0r) on keybase.
  • I have a public key whose fingerprint is EC35 C6AD 07BB 267B 3733 6ACD 029B F32B FD9D EE93

To claim this, I am signing this object:

@slax0rr
slax0rr / php
Last active December 17, 2016 09:35
Eliminate the need of installing PHP locally, and "re-route" all PHP commands to a PHP enabeld container. Control the version at which PHP is executed through environment variables. Defaults to 7.0
#!/bin/bash
#
# Run all PHP commands through a docker container
#
VER=${PHPVERSION:-7.0-cli}
ARGS="-a"
if [ $# -gt 0 ]; then
ARGS="$@"
fi
docker run -it --rm -v $(pwd):/code -w /code php:$VER php $ARGS
<?php
class Foo
{
public function bar($output, $model)
{
// magic ...
$output->addData(["foo" => $model->getFoo()]);
}
}
<?php
use Ratchet\Server\IoServer;
use Ratchet\Http\HttpServer;
use Ratchet\WebSocket\WsServer;
class Ratchet extends CI_Controller
{
public function start()
{
IoServer::factory(
package countries
//go:generate go run gen.go
type Country struct {
ISO2 string `json:"iso2"`
ISO3 string `json:"iso3"`
Name string `json:"name"`
Continent string `json:"continent"`
}

Keybase proof

I hereby claim:

  • I am slax0rr on github.
  • I am slax0r (https://keybase.io/slax0r) on keybase.
  • I have a public key ASDymdeL5oA9kJUqu7yjVwFExut-kE8gTv_b2gc-46Yzrwo

To claim this, I am signing this object:

@slax0rr
slax0rr / gist:af2486a5bd5f64c7bc95ff893618803d
Created October 11, 2024 19:24
Traefik Forward Auth Diagram
<div class="mermaid">
sequenceDiagram
actor user as User
participant traefik as Traefik
participant auth as Authentication Service
participant order as Order Service
user->>traefik: GET /order/{id}
Note right of traefik: ForwardAuth request