Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Rusting it up

Kat Marchán zkat

💭
Rusting it up
View GitHub Profile
@zkat
zkat / measures.rs
Last active September 24, 2022 23:42
WeightedMeasure impl example
View measures.rs
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
zkat / embark_profiles.txt
Created April 13, 2020 04:14 — forked from passcod/embark_profiles.txt
Dwarf Fortress configs
View embark_profiles.txt
[PROFILE]
[TITLE:WELL-PREPPED (0XABADIDEA STYLE)]
[SKILL:1:MINING:5]
[SKILL:1:HAMMER:2]
[SKILL:1:SWIMMING:2]
[SKILL:1:MELEE_COMBAT:1]
[SKILL:2:MINING:5]
[SKILL:2:SWORD:2]
[SKILL:2:CROSSBOW:2]
[SKILL:2:SWIMMING:1]
@zkat
zkat / ABNF
Last active March 21, 2018 17:49
pattern matching sketch
View ABNF
// 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
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
zkat / README.md
Created June 29, 2017 22:41
real-world vue app
View README.md

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
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) {
console.log(argv.slice(2))
}
@zkat
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
zkat / withfunctions.js
Created April 27, 2017 20:55
protoduck By Name
View withfunctions.js
const Show = duck.define(a => {
show (a) {},
toString () {}
})
@zkat
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
zkat / ohai.md
Created January 13, 2017 06:56
Director nomination for Kat Marchán
View ohai.md

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?