Skip to content

Instantly share code, notes, and snippets.

View SlimTim10's full-sized avatar

Tim Johns SlimTim10

View GitHub Profile

Employee Hierarchies Problem Set

This problem set explores a number of questions related to a company and its employees; specifically, its hierarchy of management:

const employees = [
  { name: 'Alice',  manager: null,    title: 'CEO' },
  { name: 'Bob',    manager: 'Alice', title: 'Head of Marketing' },
 { name: 'Carol', manager: 'Alice', title: 'Head of Engineering' },
@SlimTim10
SlimTim10 / imperative_vs_declarative.org
Last active October 17, 2019 19:39
imperative vs declarative

Chef John’s Pumpkin Pie

original recipe

Ingredients

  • 1 (15 ounce) can pumpkin puree
  • 3 egg yolks
  • 1 large egg
  • 1 (14 ounce) can sweetened condensed milk
  • 1 teaspoon ground cinnamon
  • 1/2 teaspoon ground ginger
@SlimTim10
SlimTim10 / examples.js
Last active October 4, 2018 19:08
Poor man's type checking
const ts = require('./type-signatures')
// Without using module
// number -> string -> number
const addNums_ = (n, str) => n + parseInt(str)
// With using module
const addNums = ts('number', 'string')(
(n, str) => n + parseInt(str)
)
const action1 = () => {
console.log('Trying thing that fails.')
return false;
};
const action2 = () => {
console.log('Trying thing that succeeds.');
return true;
};
CD %TEMP%
RD /Q /S . 2>nul
CD C:\somewhere_else
RD /Q /S . 2>nul
CD C:\another_place
RD /Q /S . 2>nul
PAUSE