Skip to content

Instantly share code, notes, and snippets.

Rusting it up

Kat Marchán zkat

Rusting it up
View GitHub Profile
zkat /
Last active September 24, 2022 23:42
WeightedMeasure impl example
use crate::Score;
pub trait Measure: std::fmt::Debug + Sync + Send {
fn calculate(&self, scores: Vec<(&Score, f32)>) -> f32;
#[derive(Debug, Clone, Default)]
pub struct WeightedMeasure;
impl Measure for WeightedMeasure {
zkat / embark_profiles.txt
Created April 13, 2020 04:14 — forked from passcod/embark_profiles.txt
Dwarf Fortress configs
View embark_profiles.txt
zkat / ABNF
Last active March 21, 2018 17:49
pattern matching sketch
// match ABNF
Match := 'match' '(' RHSExpr ')' '{' MatchClause* '}'
MatchClause := MatchClauseLHS '=>' FatArroyRHS MaybeASI
MatchClauseLHS := [MatcherExpr] (LiteralMatcher | ArrayMatcher | ObjectMatcher | JSVar)
MatcherExpr := LHSExpr
LiteralMatcher := LitRegExp | LitString | LitNumber
ArrayMatcher := '[' MatchClauseLHS [',', MatchClauseLHS]* ']' // and... whatever it takes to shove ...splat in there
ObjectMatcher := '{' (JSVar [':' MatchClauseLHS]) [',' (JSVar [':', MatchClauseLHS])]* '}' // see above note about ...splat
zkat / index.js
Last active December 16, 2017 02:29
find the cached version that's closest to a given spec
View index.js
'use strict'
const BB = require('bluebird')
const cacache = require('cacache')
const npa = require('npm-package-arg')
const pickManifest = require('npm-pick-manifest')
const ssri = require('ssri')
module.exports = cachedVersions
zkat /
Created June 29, 2017 22:41
real-world vue app

This is a useful package.json from an actual user, as opposed to an artificial/fabricated app. It should be fairly representative of the sort of things users do.

zkat / index.js
Created June 29, 2017 00:06 — forked from junosuarez/index.js
async cli app boilerplate
View index.js
#!/usr/bin/env node
if (process.mainModule === module) setImmediate(() => main(process.argv).catch(e => console.log(e.stack) && process.exit(1)))
async function main(argv) {
zkat / index.js
Last active November 10, 2022 06:41
npx is cool
View index.js
#!/usr/bin/env node
console.log('yay gist')
zkat / withfunctions.js
Created April 27, 2017 20:55
protoduck By Name
View withfunctions.js
const Show = duck.define(a => {
show (a) {},
toString () {}
zkat / figgy-pudding.js
Last active February 7, 2017 08:26
Sketch of Figgy Pudding Options Processor
View figgy-pudding.js
// Requirements:
// Unidirectional (data flows down)
// Composable (detailed definitions can be specified at a lower level)
// Declarative types and defaults
// Minimal consing
// No bubbling of side effects to parents or siblings
// Efficient
// Warn about unspecified options being read or assigned? (or make it available to run in tests?)
// opts objects readable like plain objects (maybe?)
zkat /
Created January 13, 2017 06:56
Director nomination for Kat Marchán

Yes hi it's me

Hi! I'm Kat, and I want to throw my hat in as one of the nominees for Individual Membership Director for the Node.js Foundation. Why? Because the Foundation needs to do more for its individual members. All of them.

Do you have a place at the table?

JavaScript is one of the fastest-growing and most popular programming languages in the world, and Node is its primary platform for backend usage. npm's own userbase is estimated to be around 4 million, and downloads number at around 1.6 billion every week. Every single npm user is also a Node.js user in some capacity.

How many of those people have their interests represented in leadership? Which groups of people have we served best? Which groups do we never hear about? Who are the contributors, really? Do we want to change that? How could we?