Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Dave Furfero furf

🎯
Focusing
Block or report user

Report or block furf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@furf
furf / index.js
Created Jul 13, 2019
Coding challenge for constructing and traversing (depth-first) trees.
View index.js
// Found at https://www.glassdoor.com/Interview/Reddit-Senior-Software-Engineer-Interview-Questions-EI_IE796358.0,6_KO7,31.htm
// # a list of strings.Each string is a management / report relationship.
// #
// # EXAMPLE INPUT:
// #
// #[
// # 'B,E,F',
// # 'A,B,C,D',
// # 'D,G,I',
View rot13.js
function reduceRot13Cipher(map, c, i, abc) {
const off = 13;
const len = abc.length;
const j = (i + off) % len;
map[c] = abc[j];
return map;
}
const rot13 = (() => {
const abc = 'abcdefghijklmnopqrstuvwxyz';
@furf
furf / 0.reverseList.js
Created Aug 14, 2018
Reverse a Linked List, because why not.
View 0.reverseList.js
function buildList(values) {
return values.reduceRight((next, value) => ({ value, next }), null);
}
function getValues(node) {
const values = [];
while (node) {
values.push(node.value);
node = node.next;
}
@furf
furf / postmortem.md
Created Jun 22, 2018 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491
View postmortem.md

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
View gist:09b115e96d7dc8498b3136db3760e507
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
@furf
furf / Parallax.js
Last active May 26, 2017
React components for parallax scrolling.
View Parallax.js
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames/bind';
const now = Date.now();
const PERSPECTIVE_KEY = `__perspective--${now}__`;
const DISABLED_KEY = `__perspective--${now}--disabled__`;
/**
View keybase.md

Keybase proof

I hereby claim:

  • I am furf on github.
  • I am furf (https://keybase.io/furf) on keybase.
  • I have a public key ASBc1_hHJft8h6eTvM9D7Y8NxDFW56ds5T0DrMLhp4eFhAo

To claim this, I am signing this object:

@furf
furf / README.md
Created Jul 15, 2016 — forked from jxson/README.md
README.md template
View README.md

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@furf
furf / fu.js
Last active Jun 20, 2016
furf’s functional funpack
View fu.js
/**
* Introducing fu: furf's functional funpack.
* "Putting the F-U back in JS!"
*
* fu.Array.map([1, 2, 3], a => a * 2) => [2, 4, 6]
* fu.String.repeat('fu ', 3) => "fu fu fu"
*/
this.fu = (function() {
const call = Function.prototype.call;
@furf
furf / fib-dyna-in-place.js
Created Jun 2, 2016
Comparison of recursive, memoized recursive and dynamic programming approaches to calculating the Fibonacci series.
View fib-dyna-in-place.js
function fibDynaInPlace(n) {
let dp = [0, 1];
for (let i = 2; i <= n; ++i) {
dp = [dp[1], dp[1] + dp[0]];
}
return dp[1];
}
You can’t perform that action at this time.