Skip to content

Instantly share code, notes, and snippets.

Amanda Falke abstractmachines

Block or report user

Report or block abstractmachines

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
abstractmachines / partial-application-and-currying.js
Last active Nov 16, 2019
Partial Application and Function Currying
View partial-application-and-currying.js
import _ from 'lodash';
/* Function currying transforms a multiple arity function into
a single arity/unary function. That unary function returns a
new unary function to process subsequent args, one at a time,
after the first argument is applied.
In JavaScript, this access to params outside of the function's
immediate local scope (for example, b on line 13) is enabled via lexical scoping and closures.

  • creates a new array with initial Array's properties transformed/mapped into the new Array.
  • @param: takes in a transform function as argument, and an iterator index.


  • creates a new, singular accumulator that's the accumulation of all of the operations performed in the reduce's transform function.
  • @param: takes in an accumulator as arg, and an iterator index.
abstractmachines / lodash_.reduce.txt
Last active Oct 12, 2019
_.reduce use case validator
View lodash_.reduce.txt
- Lodash reduce is conceptually just like Array.prototype.reduce, in that it
- maps one of an array's properties into a single accumulator value.
- Validation for an array of failure messages
coming back from a server.
- .push() mutates, but multiFail is new data.
const validateAResponse = ({ response } = {}) => {
if (!_.isEmpty(response.failuresArray)) {
abstractmachines /
Last active Aug 1, 2018
Bash Profile (for upcoming dotfiles repo)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/" ] && . "$NVM_DIR/" # This loads nvm

# This runs nvm on each new shell session.
enter_directory() {
  if [[ $PWD == $PREV_PWD ]]; then

git Workshop: Motivation

The majority of blogs and documentation about git are one of two things:

  1. technically correct while being very difficult for newbies to digest,


  1. technically incorrect "guides" which help people learn, but miss many CS fundamentals and details and/or advise learners to "avoid/ignore" "advanced" features which software engineers use daily on the job.

This workshop serves to instruct on the industry usage of git using methods and theory that are agreed-upon by most senior engineers, and to do so while covering CS and SWE fundamentals. As such, this workshop will address the features of git which many blogs state are "too hard to use" such as rebasing, as these git workflows are considered a fundamental practice of intermediate git operation when collaborating on teams.

abstractmachines / iterator-string-for-of-spread.js
Last active Nov 2, 2017
JavaScript Iterators: Strings, spread, and for of
View iterator-string-for-of-spread.js
/* JavaScript Iterators
Strings as data source; for of and spread operator as data consumers
Strings can be consumed as iterables using the spread operator.
Note that strings will be parsed according to code points, not by character,
and so num characters parsed will be somewhat nondeterministic.
1 - Axel Rauschmeyer:
2 -
abstractmachines / set-map-iterator.js
Last active Jul 5, 2018
JavaScript Iterators: Sets and Maps
View set-map-iterator.js
/* JavaScript Iterators
Sets and Maps
Sets and Maps can be made Iterable/Iterator by using the methods .entries(), .keys(),
values(), and/or via for of construct.
A Set is a unique (non repeated) version of a Bag data structure. Characteristic equation
is contains() or has().
A Map (in JS) is a key-value pair data structure, unordered (in order of insertion).
abstractmachines / arrayiterator.js
Last active Jul 5, 2018
JavaScript Iterators : Arrays
View arrayiterator.js
/* JavaScript Iterators
An Iterator Object is a data structure that has a .next() method that can be called repeatedly.
Iterators use the Well Known Symbol called Symbol.iterator.
(The Iterable Object has an Iterator pointer for indexing.)
The Iterator object has two properties, value and done (boolean). Iteration will continue so
long as done is falsey. Once done is truthy, iteration stops.
Just like C++ iterators for C++ data structures, JavaScript iterators iterate through an entire
abstractmachines / Symbol.hasinstance.js
Last active Feb 23, 2018
Well Known Symbols : instanceof via custom Symbol.hasinstance
View Symbol.hasinstance.js
/* Well Known Symbols : Symbol.hasinstance
1 -
2 -
3 -
4 -
Well Known Symbols are Reflection via implementation in ES6.
Reflection in Metaprogramming: observing low level internals of a programming language/program.
abstractmachines / promiseunderthehood.js
Created Oct 26, 2017
Dave's pwomise. Remember that the catch is not implemented correctly, recall the tree structure of Promise.
View promiseunderthehood.js
class Pwomise {
constructor (fn) {
fn(this._resolve.bind(this), this._reject.bind(this))
this._thens = []
this._catches = []
_resolve (value) {
while (this._thens.length > 0) {
You can’t perform that action at this time.