This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I am attesting that this GitHub handle millsky is linked to the Tezos account tz1QnBdcdVBxrJXuAFXwnaZyHTijU7gjQF3E for tzprofiles | |
sig:edsigu2sR42XM151Go6pxcpG27DhKamy61r6M2KtrU8GHxt2jWYHTT489yvduoCDDut2Bp74dAbeCYMSALFge9v3utjdQsiu7mB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Context example 1: Using Prototype */ | |
/* A functions context may be updated via the prototype */ | |
/* Currently this.speak refers to the global this, window in the browser */ | |
function animal() { | |
this.category = 'animal'; | |
/* Ran w/o context on the global scope this will throw an error */ | |
this.speak(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const merge = (a1,a2) => { | |
if (a1.length === 0) { | |
return a2; | |
} | |
if (a2.length === 0) { | |
return a1; | |
} | |
if (a1[0] <= a2[0]) { | |
return [ | |
a1[0], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as L from 'partial.lenses'; | |
import * as R from 'ramda'; | |
const classA = { | |
p: 2, | |
d: 2, | |
c: true, | |
classB: null, | |
}; | |
const classAOptic = ['classB']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { lazy, Suspense } from "react"; | |
import ReactDOM from "react-dom"; | |
import R from "ramda"; | |
import { task, of } from "folktale/concurrency/task"; | |
function processService(p) { | |
return p.data; | |
} | |
const getDataFailure = data => ({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as R from "ramda"; | |
const log = R.tap(R.bind(console.log, console)); | |
// F1 :: float -> float | |
const f1 = f => f * 1.23; | |
// F2 :: float -> float | |
const f2 = f => f * 1.345; | |
// F3 :: float -> float | |
const f3 = R.compose( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Build an adjacency matrix for a super simple tree a -> b,c */ | |
const m = [ | |
[0, 1, 0, 0, 0], | |
[0, 0, 1, 1, 0], | |
[0, 0, 0, 0, 1], | |
[0, 0, 0, 0, 0], | |
[0, 0, 0, 0, 0] | |
]; | |
/* Data at each node */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import R from 'ramda'; | |
import { task, of } from 'folktale/concurrency/task'; | |
import hash from 'object-hash'; | |
function processService(p) { | |
return p.data; | |
} | |
const getDataFailure = data => ({ | |
type: 'FAILURE_TYPE', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function observer() { | |
const data = {}; | |
const callbacksObj = {}; | |
const set = (property, value) => { | |
data[property] = value; | |
notify(property); | |
}; | |
const notify = (property) => { | |
if(!property) { | |
throw new TypeError('Property "property" is not type string') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sortTable(table,col){ | |
if(table.nodeName != "TABLE"){ | |
throw new Error("Node is not of type TABLE"); | |
return; | |
} | |
/* DEEP CLONE WILL BREAK THE REF */ | |
//table = table.cloneNode(true); | |
var rows = [].slice.call(table.tBodies[0].rows,1); | |
var tBody = table.tBodies[0]; | |
/* SORT MAP AND REPLACE */ |
NewerOlder