Skip to content

Instantly share code, notes, and snippets.

View calam1's full-sized avatar

Christopher Lam calam1

View GitHub Profile
@calam1
calam1 / envoy-filter.yaml
Created April 14, 2021 15:32 — forked from inaiat/envoy-filter.yaml
Setting request headers with values from a JWT
apiVersion: "security.istio.io/v1beta1"
kind: RequestAuthentication
metadata:
name: echoserver
namespace: default
spec:
selector:
matchLabels:
app: echoserver
jwtRules:
@calam1
calam1 / LICENSE
Created March 28, 2021 17:37 — forked from rcook/LICENSE
Traits and polymorphism in Rust
The MIT License (MIT)
Copyright (c) 2020 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@calam1
calam1 / Adding tmux
Created February 27, 2021 01:58 — forked from sshadmand/Adding tmux
The best and greatest tmux.conf ever
Create a tmux conf file
#> touch ~/.tmux.conf
Install TMP
#> git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
[Copy and paste tmux.conf below into local file.]
Load tmux configurations
#> tmux source-file ~/.tmux.conf
@calam1
calam1 / psql_useful_stat_queries.sql
Last active February 5, 2020 14:33 — forked from anvk/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@calam1
calam1 / reader.js
Last active December 18, 2017 01:16 — forked from dypsilon/reader.js
Example usage of the reader monad.
/**
* This short program will encrypt the user password
* and insert a new record into a mock database.
*/
const Reader = require('fantasy-readers');
const R = require('ramda');
const crypto = require('crypto');
// our mock database
const database = [