Skip to content

Instantly share code, notes, and snippets.

View zkat's full-sized avatar
🦀
Rusting it up

Kat Marchán zkat

🦀
Rusting it up
View GitHub Profile
@zkat
zkat / logloc.js
Last active August 29, 2015 14:00
Log logger locations globally
var old = {};
module.exports = {
install: install,
uninstall: uninstall,
methods: ["log", "info", "warn", "error"]
};
install();
;;;
;;; Git utils
;;;
(require 'vc-git nil t)
(defcustom git-grep-switches "-E -I -nH -i --no-color"
"Switches to pass to `git grep'."
:type 'string)
(defun git-grep (regexp)
@zkat
zkat / gist:1930f5b34e2aae56b82c
Last active August 29, 2015 14:06
playing around with auto-filtered/mapped `can.List`
function test() {
var sourceList = new can.List();
var stream = sourceList.filteredStream(function(todo, map) {
if (!todo.attr("done")) {
todo.attr("steps").forEach(map);
}
});
var targetList = stream.toList();
sourceList.push({

Keybase proof

I hereby claim:

  • I am zkat on github.
  • I am zkat (https://keybase.io/zkat) on keybase.
  • I have a public key whose fingerprint is AADE A47E 34FE F0D4 7EB7 F1BF 6FF7 93FB BD6F E1B5

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am zkat on github.
  • I am zkat (https://keybase.io/zkat) on keybase.
  • I have a public key whose fingerprint is 3F34 D66F DA3A B6B2 4887 2174 AEB5 29C0 8A3C 7E9E

To claim this, I am signing this object:

@zkat
zkat / gist:441379747a61beece62c
Last active August 29, 2015 14:24
Javascript translation of writing inline caching through load-time-value and inlining.

Base code

Consider the following code, and how it can be affected by the following transformations:

function foo () {
  return {x: 5}
}
foo() === foo() // => false
@zkat
zkat / iteration.js
Last active July 13, 2016 22:49
Short guide to iteration functions!
var arr = [1,2,3,4]
// Array#map is for going from array A, to array-of-same-length B, with no side-effects.
var arrPrime = arr.map(function (num) { return num + 1 })
// forEach doesn't return anything useful (just `undefined`), so we use it for "side-effects".
var otherArr = []
arr.forEach(function (num) {
if (num % 2 !== 0) {
otherArr.push(num) // this is a side-effect
@zkat
zkat / genfun-protocol.js
Last active August 27, 2016 02:43
Sketched out example of protocol library built on top of genfun
var Protocol = require('genfun-protocol')
var Eq = Protocol(['a', 'b'], {
eql: ['a', 'b'],
// Extra set of [] and you can add a default implementation!
// This will dispatch only for existing instances
// (that is, it doesn't fall through to [Object, Object] in this case)
neq: [['a', 'b'], (a, b) => !Eq.eql(a, b)]
})
@zkat
zkat / protocol-extension.js
Last active September 17, 2016 09:59
Sketched out idea for extending protocols with additional protocol constraints
const Eq = protocol(['a', 'b'], {
eq: ['a', 'b'],
neq: ['a', 'b']
})
const Ord = protocol(Eq('a', 'b'), ['a', 'b'], {
gt: ['a', 'b'],
lt: ['a', 'b']
})
@zkat
zkat / ohai.md
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?