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 / 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
}
We can make this file beautiful and searchable if this error is corrected: It looks like row 24 should actually have 7 columns, instead of 2. in line 23.
ced_name_2016,yes_population,yes_percentage,no_population,no_percentage,total_population,total_percentage Banks,37736,44.9,46343,55.1,84079,100 Barton,37153,43.6,47984,56.4,85137,100 Bennelong,42943,49.8,43215,50.2,86158,100 Berowra,48471,54.6,40369,45.4,88840,100 Blaxland,20406,26.1,57926,73.9,78332,100 Bradfield,53681,60.6,34927,39.4,88608,100 Calare,54091,60.2,35779,39.8,89870,100 Chifley,32871,41.3,46702,58.7,79573,100 Cook,47505,55.0,38804,45.0,86309,100 Cowper,57493,60.0,38317,40.0,95810,100 Cunningham,60906,65.7,31840,34.3,92746,100 Dobell,59475,65.7,30987,34.3,90462,100 Eden-Monaro,57223,64.9,30926,35.1,88149,100 Farrer,48432,55.2,39297,44.8,87729,100 Fowler,27847,36.3,48782,63.7,76629,100 Gilmore,59322,62.0,36386,38.0,95708,100 Grayndler,73208,79.9,18429,20.1,91637,100 Greenway,38016,46.4,43980,53.6,81996,100 Hughes,51337,58.4,36558,41.6,87895,100 Hume,51284,58.6,36271,41.4,87555,100 Hunter,59137,64.4,32723,35.6,91860,100 Kingsford Smith,56297,64.1,31510,35.9,87807,100 Lindsay,