Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin Lubick kjlubick

View GitHub Profile
View family_fan_chart.js
canvas.width = 3000;
canvas.height = 2200;
canvas.style.width = "900px";
const surface = CanvasKit.MakeCanvasSurface(canvas);
if (!surface) {
throw 'Could not make surface';
}
const skcanvas = surface.getCanvas();
const paint = new CanvasKit.SkPaint();
@kjlubick
kjlubick / 1_toContainRegexMatcher.js
Last active Sep 26, 2018
Custom matcher for Jasmine - matcher for a list of strings to have (at least) one that matches a given regex.
View 1_toContainRegexMatcher.js
const toContainRegexMatcher = {
// see https://jasmine.github.io/tutorials/custom_matcher
// for docs on the factory that returns a matcher.
'toContainRegex': function(util, customEqualityTesters) {
return {
'compare': function(actual, regex) {
if (!(regex instanceof RegExp)) {
throw `toContainRegex expects a regex, got ${JSON.stringify(regex)}`;
}
let result = {};
@kjlubick
kjlubick / docker-cleanup-resources.md
Created Mar 13, 2018 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
@kjlubick
kjlubick / spanish_letters.ahk
Created May 28, 2016
Autohotkey script to easily add spanish letters to keyboards w/o numpads
View spanish_letters.ahk
#Hotstring EndChars `n `t
# Type ' then letter for lower case " then letter for uppercase
# The accented letter will appear after you hit tab, return or space.
::'a::
Send, {U+00E1}
Return
::"A::
Send, {U+00C1}
@kjlubick
kjlubick / d3-svg-example-animation.md
Last active May 18, 2016
This is an example for Google I/O of the D3 visualization, with animation.
@kjlubick
kjlubick / afl-fuzz-readme.md
Last active Oct 28, 2015
Readme for afl-fuzz
View afl-fuzz-readme.md

================== american fuzzy lop

Written and maintained by Michal Zalewski lcamtuf@google.com

Copyright 2013, 2014, 2015 Google Inc. All rights reserved. Released under terms and conditions of Apache License, Version 2.0.

For new versions and additional information, check out:

@kjlubick
kjlubick / afl-fuzz-help.txt
Created Oct 28, 2015
Help text for afl-fuzz
View afl-fuzz-help.txt
./afl-fuzz [ options ] -- /path/to/fuzzed_app [ ... ]
Required parameters:
-i dir - input directory with test cases
-o dir - output directory for fuzzer findings
Execution control settings:
-f file - location read by the fuzzed program (stdin)
@kjlubick
kjlubick / afl-fuzz-whitepaper.md
Last active Oct 28, 2015
Technical "whitepaper" for afl-fuzz. Copied from http://lcamtuf.coredump.cx/afl/technical_details.txt, (which is released under the Apache 2.0 License) and slightly modified for GitHub Flavored Markdown
View afl-fuzz-whitepaper.md

=================================== Technical "whitepaper" for afl-fuzz

This document provides a quick overview of the guts of American Fuzzy Lop. See README for the general instruction manual; and for a discussion of motivations and design goals behind AFL, see historical_notes.txt.

  1. Design statement

@kjlubick
kjlubick / ISMCTS.py
Created Sep 21, 2015
An example of Information Set Monte Carlo Tree Search from http://www.aifactory.co.uk/newsletter/2013_01_reduce_burden.htm
View ISMCTS.py
# This is a very simple Python 2.7 implementation of the Information Set Monte Carlo Tree Search algorithm.
# The function ISMCTS(rootstate, itermax, verbose = False) is towards the bottom of the code.
# It aims to have the clearest and simplest possible code, and for the sake of clarity, the code
# is orders of magnitude less efficient than it could be made, particularly by using a
# state.GetRandomMove() or state.DoRandomRollout() function.
#
# An example GameState classes for Knockout Whist is included to give some idea of how you
# can write your own GameState to use ISMCTS in your hidden information game.
#
# Written by Peter Cowling, Edward Powley, Daniel Whitehouse (University of York, UK) September 2012 - August 2013.
@kjlubick
kjlubick / ArrayListString.java
Created Apr 9, 2015
String ArrayList. Targeted at AP Computer Science Students. Used with https://www.youtube.com/watch?v=JcTA3grnERo
View ArrayListString.java
public class ArrayListString{
private String[] arr;
private int capacity;
private int size;
public ArrayListString() {
arr = new String[10];
capacity = 10;
size = 0;
You can’t perform that action at this time.