Skip to content

Instantly share code, notes, and snippets.

View yamad's full-sized avatar

Jason Yamada-Hanff yamad

View GitHub Profile
@yamad
yamad / libyaml_cmake_stable.patch
Created July 2, 2012 18:17
CMake build for libyaml stable
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..0f6b475
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,52 @@
+cmake_minimum_required(VERSION 2.8.4) # >= 2.8.4 needed for CYGWIN behavior
+project(yaml C)
+
+# package version numbers

Keybase proof

I hereby claim:

  • I am yamad on github.
  • I am jyamad (https://keybase.io/jyamad) on keybase.
  • I have a public key whose fingerprint is D92C 5315 0AFD B339 4FE9 9324 5B13 0E57 4A12 2A3D

To claim this, I am signing this object:

@yamad
yamad / ci_test.R
Created March 8, 2017 07:58
confidence interval simulation
library(tidyverse)
## Confidence Interval simulation
## ------------------------------
##
## Demonstrate properties of (95%) confidence intervals and how to
## calculate them. Note that some confidence intervals _will not_
## contain the true value.
##
##
@yamad
yamad / loopperf.js
Last active September 16, 2020 00:25
Benchmarking javascript loop performance
Install `benchmark` (https://benchmarkjs.com/) and run:
npm install --save benchmark
node loopperf.js
@yamad
yamad / group.js
Created July 4, 2018 00:18
sql-style joins using key decoration in javascript
function mergeData(...arrs) {
const getKey = el => el.affId + ',' + el.offId
const full = concat(arrs)
const groupedObj = groupBy(full, getKey)
const grouped = Object.values(groupedObj)
const merged = grouped.map(mergeObjects)
return merged
}
function concat(arrs) {
@yamad
yamad / myzip.py
Last active August 20, 2018 21:57
my python zip
def myzip(*args):
iters = [iter(a) for a in args]
while True:
try:
yield tuple([next(it) for it in iters])
except StopIteration:
return
import pytest
import hypothesis as hyp
import hypothesis.strategies as st
@st.composite
def st_intervals(draw, min_value=None, max_value=None):
lo = draw(st.integers(min_value, max_value))
hi = draw(st.integers(lo, max_value))
return (lo, hi)