Skip to content

Instantly share code, notes, and snippets.

View jethrokuan's full-sized avatar
💩

Jethro Kuan jethrokuan

💩
View GitHub Profile
@jethrokuan
jethrokuan / latency.txt
Created February 19, 2017 06:24 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD

Keybase proof

I hereby claim:

  • I am jethrokuan on github.
  • I am jethroksy (https://keybase.io/jethroksy) on keybase.
  • I have a public key whose fingerprint is 9A69 81EE 6543 8CBF 592A C3D5 E25D BF2B EE01 EB11

To claim this, I am signing this object:

Discussion Group Exercises Week 4

Problems

Problem 1

What is the recursive definition of Pascal's triangle? What are the base cases?

  1. row == 1
  2. column == 1 (first element of each row)
  3. column == row(last element of each row)
@jethrokuan
jethrokuan / squat.js
Last active July 23, 2018 07:01
Archipelago Squatter
// Bookmarklet Usage:
javascript:(function () {
var audio = new Audio('https://notificationsounds.com/notification-sounds/definite-555/download/ogg');
var targetNode = document.getElementsByClassName("ng-toast__list")[0];
var config = {
childList: true,
subtree: true
};
@jethrokuan
jethrokuan / weekly_review.org
Created September 14, 2018 08:36
Weekly Review

Get Clear [0/3]

  • [ ] Collect Loose Papers and Materials: Pull out all miscellaneous pieces of paper, business cards, receipts, and so on that have crept into the crevices of your desk, clothing, and accessories. Put it all in your in-tray for processing.
  • [ ] Get “IN” to Zero: Review any meeting notes and miscellaneous scribbles on notepaper or in your mobile devices. Decide and list any action items, projects, waiting-fors, calendar events, and someday/maybes, as appropriate. File any reference notes and materials. Get the “in” areas of e-mails, texts, and voice mails to
@jethrokuan
jethrokuan / email.nix
Created September 23, 2018 06:31
NixOS email setup
{pkgs, ...}:
{
environment.systemPackages = with pkgs; [
pass
isyncUnstable
msmtp
notmuch
pinentry_qt5
];
@jethrokuan
jethrokuan / networking.nix
Created September 23, 2018 06:35
Hosts file
{pkgs, ...}:
let
hostsVersion = "1553048103e57638ae653843ae1b8258ece1423a";
in
{
networking.networkmanager.enable = true;
networking.extraHosts = builtins.readFile (pkgs.fetchurl {
url = "https://github.com/StevenBlack/hosts/raw/${hostsVersion}/alternates/fakenews-gambling-porn/hosts";
@jethrokuan
jethrokuan / shell.nix
Created September 23, 2018 06:42
Python Env
with import <nixpkgs> {};
(python36.buildEnv.override {
extraLibs = with pkgs.python36Packages;
[
pip
scikitlearn
tensorflow
numpy
scipy
@jethrokuan
jethrokuan / default.nix
Created December 4, 2018 06:09
Ocaml Environment
with import <nixpkgs> {};
let
ocamlPackages = pkgs.recurseIntoAttrs pkgs.ocamlPackages_latest;
# findlibSiteLib = "${ocamlPackages.findlib}/lib/ocaml/${ocamlVersion}/site-lib";
# ocamlVersion = (builtins.parseDrvName ocamlPackages.ocaml.name).version;
# ocamlInit = pkgs.writeText "ocamlinit" ''
# let () =
# try Topdirs.dir_directory "${findlibSiteLib}"
# with Not_found -> ()
@jethrokuan
jethrokuan / default.nix
Last active December 4, 2018 06:20
Ocaml Environment
with import <nixpkgs> {};
let
ocamlPackages = pkgs.recurseIntoAttrs pkgs.ocamlPackages_latest;
findlibSiteLib = "${ocamlPackages.findlib}/lib/ocaml/${ocamlVersion}/site-lib";
ocamlVersion = (builtins.parseDrvName ocamlPackages.ocaml.name).version;
ocamlInit = pkgs.writeText "ocamlinit" ''
let () =
try Topdirs.dir_directory "${findlibSiteLib}"
with Not_found -> ()