Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ryanspradlin
ryanspradlin / find_missing_lines.sh
Created March 25, 2011 20:13
Finds lines present in file A that are missing in file B
#!/bin/sh
FILEA=$1
FILEB=$2
grep -v -x -f $FILEB $FILEA

Keybase proof

I hereby claim:

  • I am ryanspradlin on github.
  • I am ryanspradlin (https://keybase.io/ryanspradlin) on keybase.
  • I have a public key whose fingerprint is 1A8A CC82 73EC 6A41 CAA0 391E E457 1E77 D13D 6150

To claim this, I am signing this object:

type BatchLoadFn<K, V> = (keys: Array<K>) => Promise<Array<V | Error>>;
type LoadAllFn<K, V> = () => Promise<Array<[K, V]>>;
type Options<K, V> = {
batch?: boolean,
cache?: boolean,
cacheMap?: CacheMap<K, Promise<V>>,
cacheKeyFn?: (key: any) => any
};
@ryanspradlin
ryanspradlin / brent.js
Last active March 20, 2024 06:48
Javascript implementation of Brent's Method, a root-finding algorithm
/* @flow */
// Derived from: https://en.wikipedia.org/wiki/Brent%27s_method#Algorithm
// Brent's method is a hybrid root-finding algorithm that combines the
// faster/less-reliable inverse quadradic interpolation and secant methods with
// the slower/more-reliable bisection method.
export function brent(
f: (x: number) => number,
lowerBound: number,