Skip to content

Instantly share code, notes, and snippets.

@predakanga
predakanga / 01-current.php
Last active April 1, 2020 04:40
COPA Comparisons
$params = new TokenValidationParameters();
$params->RequireExpirationTime = false;
$params->ValidateIssuerSigningKey = true;
$params->IssuerSigningKey = "...";
$params->ValidIssuer = $issuer;
$params->ValidAudience = $issuer;
<?php
class Foo {
public function __construct() {
$this->prop = 'a';
$this->{'contains-minus'} = 'b';
$this->{''} = 'c';
}
}
@predakanga
predakanga / gist:2376835
Created April 13, 2012 13:27
Echoprint setup and usage

Requirements

For libcodegen

  • Boost >= 1.35
  • zlib

Additional requirements for the codegen binary

@predakanga
predakanga / Vagrantfile.rb
Last active February 1, 2019 17:31
Testcase for IPVS over IPSec
require 'digest/md5'
require 'base64'
# Using a static token to simplify automation
$kube_master = "scheduler"
$kube_token = "aaaaaa.bbbbbbbbbbbbbbbb"
$kube_cidr = "192.168.0.0/16"
$hosts = {
"scheduler" => "172.16.0.2",
"worker" => "172.16.0.4"
# Calico Version v3.4.0
# https://docs.projectcalico.org/v3.4/releases#v3.4.0
# This manifest includes the following component versions:
# calico/node:v3.4.0
# calico/cni:v3.4.0
# This ConfigMap is used to configure a self-hosted Calico installation.
kind: ConfigMap
apiVersion: v1
metadata:
# Because functions are variables, we can copy and delete the following function
def foo():
return True
bar = foo
del foo
# foo() would now cause an error
# bar() would return True
{% for key, val in data %}
Key: {{ key }}
Value: {{ val ?: "0" }}
{% endfor %}
<?php
function indirectStringToUpper($word) {
return strtoupper($word);
}
class FuncBench {
public function benchLoopDirectFunction() {
$words = ['i', 'am', 'not', 'shouting'];
$shouts = [];
[1.12]MoVillages-1.5.4.jar
A Block of Charcoal-1.1.jar
AbyssalCraft-1.12.2-1.9.4.6.jar
AbyssalCraft Integration-1.12.2-1.6.2.jar
ActuallyAdditions-1.12.2-r133.jar
ActuallyBaubles-1.12-1.1.jar
advancedmortars-1.12.2-1.6.20.jar
Animalium-0.3.6.jar
antiqueatlas-1.12.2-4.4.7.jar
AppleCore-mc1.12.2-3.1.1.jar
butwhereisthebeef.dyndns.com
tls some@email.com
timeouts none
proxy / localhost:8096 {
websocket
transparent
}