Skip to content

Instantly share code, notes, and snippets.

View HerbCaudill's full-sized avatar

Herb Caudill HerbCaudill

View GitHub Profile
@HerbCaudill
HerbCaudill / optimalBloomFilter
Created November 18, 2020 13:38
Self-optimizing Bloom filter
import { BloomFilter } from 'bloomfilter' // https://github.com/jasondavies/bloomfilter.js
/**
* Returns an optimally configured Bloom filter for the given number of elements, using the
* calculations from https://www.di-mgt.com.au/bloom-filter.html .
* @param n The number of elements to be added to the Bloom filter
* @param p The target false positive rate
*/
const optimalBloomFilter = (n: number, p: number = 0.01) => {
const LOG2 = Math.log(2)
@HerbCaudill
HerbCaudill / 8.jsx
Last active October 7, 2020 12:46
css-article-8.jsx
<button
sx={{
color: 'white',
bg: 'primary',
m: 10,
px: 4,
py: 2,
fontSize: 2,
boxShadow: 'large',
}}
@HerbCaudill
HerbCaudill / 7.jsx
Created October 7, 2020 12:34
css-article-07.jsx
<button class="m-4 bg-primary text-white px-4 py-2 text-xs shadow-lg ">
Click me
</button>
@HerbCaudill
HerbCaudill / 6.jsx
Last active October 7, 2020 12:33
css-article-6.jsx
<button class="ma4 bg-red white ph4 pv2 f6 shadow">
Click me
</button>
@HerbCaudill
HerbCaudill / 5.jsx
Created October 7, 2020 12:30
css-article-5.jsx
let styles = {
background: 'lightBlue',
border: '1px solid blue',
borderRadius: 2,
}
<div style={styles}>...</div>
@HerbCaudill
HerbCaudill / 4.jsx
Created October 7, 2020 12:30
css-article-4.jsx
let styles = {
background: 'lightBlue',
border: '1px solid blue',
borderRadius: 2,
'&:hover': { background: 'darkBlue' }
}
<div css={styles}>...</div>
@HerbCaudill
HerbCaudill / 3.jsx
Created October 7, 2020 12:29
css-article-3.jsx
let styles = css`
background: lightBlue;
border: 1px solid blue;
border-radius: 2px;
@:hover {
background: darkBlue;
}
}`
<div css={styles}>...</div>
@HerbCaudill
HerbCaudill / css-article-1.css
Last active October 7, 2020 12:28
css-article-1.css
.tabstrip__tab {
...
background: 'lightBlue';
}
.tabstrip__tab--active {
...
background: 'darkBlue';
}
@HerbCaudill
HerbCaudill / Black_Crow.xml
Created June 7, 2020 08:01
Black_Crow.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 3.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
<score-partwise version='3.0'>
<work>
<work-title>Black Crow</work-title>
</work>
<movement-title>JONI MITCHELL</movement-title>
<identification>
<creator type='composer'>arr. by Herb Caudill</creator>
<encoding>

Keybase proof

I hereby claim:

  • I am herbcaudill on github.
  • I am hc3 (https://keybase.io/hc3) on keybase.
  • I have a public key ASCf7bop30lk9KoD2a9HYRGVxdH-dN3B_WO712k4HtkP-Qo

To claim this, I am signing this object: