Skip to content

Instantly share code, notes, and snippets.

@kwyn
kwyn / keybase.md
Last active November 24, 2022 16:47

Keybase proof

I hereby claim:

  • I am kwyn on github.
  • I am kwyn (https://keybase.io/kwyn) on keybase.
  • I have a public key whose fingerprint is 5E41 8925 FB7C 0EC3 18DB D01C 8713 06BE 6646 771B

To claim this, I am signing this object:

@kwyn
kwyn / crontab.conf
Last active March 29, 2020 21:11
Consturction timelapse project
* 8-16 * * 1-5 ffmpeg -f video4linux2 -s 1920x1080 -i /dev/video0 -vframes 1 /home/kwyn/timelapse/$(date "-%Y-%m-%d_%H:%M:%S")-snapshot.jpeg

Load Testing Approach.

The theory behind this testing approach is based on Little's Law and USL (Universal Scalability Law) which are explained in more detail in Coda's blog post

One thing left out from the above article is how to go about load testing. In this document I'll go over how to load test variations on infrastructure configurations

You'll need a few key tools:

  • ghz (like gigahertz... get it?) a load testing tool used for gRPC
  • usl go get -u github.com/codahale/usl to install the usl CLI
{
"startDate": "2019-06-15",
"endDate": "2019-09-16"
}
@kwyn
kwyn / regional_autoscale_deploy.yaml
Last active January 15, 2019 21:13
Regional Autoscaling for GKE using Google Deployment Manager
resources:
- name: provision-test
# type: container.v1beta1.cluster
type: gcp-types/container-v1beta1:projects.locations.clusters
properties:
# Region that the cluster will be deployed to
parent: 'projects/kwyn-testbed/locations/us-west1'
cluster:
loggingService: logging.googleapis.com
initialClusterVersion: "1.11.5-gke.5"
@kwyn
kwyn / NanoSpring_Script.awk
Created May 9, 2016 15:41
Carve a nanospring out of a 3d point file
BEGIN{
#define PI for program
PI=3.14159;
#define radius of spring form, helical body radius
r=6;
#define pitch
p=7;
b= p/(2*PI);
#define diameter of spring wire and radius, cross-sectional thickness
d=4;
  • Devote 90 minutes a day to "practice"
    • practice = working on something fun with a path
  • Build to learn not to use/finish
  • Seven Slotted Learning Todo List
    • Strict seven slots
    • When it's full and you want to add something remove something and place in a "someday" file in your digital notepad of choice
  • Manage anxiety by converting to apathy or control
  • Apathy to get things done and avoid dread
@kwyn
kwyn / bloom.js
Created September 11, 2015 21:54
Bloom filter in JavaScript because reasons.
var BloomFilter;
(function(){
BloomFilter = function(length){
this._limit = length;
this._storage = makeStorage.call(this);
}
var makeStorage = function(){
var that = this;
function trigger (match, offset, func){
var trigger_height = $(match).offset().top + offset;
var element_height = $(match).height();
$(window).on('scroll-tick', function() {
var scrolltop = $(window).scrollTop();
if(scrolltop > trigger_height && scrolltop < trigger_height + element_height){
func();
}
});
}
@kwyn
kwyn / config.js
Last active August 29, 2015 14:10
var config = module.exports = {};
config.server = {
views: {
engines: {
jade: require('jade')
},
basePath: __dirname,
path: './templates',
partialsPath: './templates/partials',