- Keycap: [Plastic outer covering][keycaps] of a particular key typically inscribed with the character that gets sent to the computer when struck.
- PCB: Printed Circuit Board (really, just a circuit board), which registers keystrokes and sends them to the computer.
- Switch: underlying mechanism that the keycap covers, and in some way creates contact with the PCB to let it know that a keystroke needs
This file contains 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 data = {'a.b': 1, 'c.d': 7, 'c.d': 9} | |
const assocPathDataLast = curry( | |
(mergeAble, pathList, val) => assocPath(pathList, val, mergeAble) | |
); | |
const processKeys = compose( | |
split('.'), | |
head | |
); |
This file contains 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 clamp = (min, max, x) => Math.min(Math.max(x, min), max); | |
const clmp = (minVal, maxVal) => compose( | |
min(maxVal), | |
max(minVal) | |
); |
This file contains 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 data1 = [ | |
{id: 1, status: true}, | |
{id: 2, status: false}, | |
{id: 3, status: true}, | |
]; | |
const data2 = [ | |
{id: 1, status: true}, | |
{id: 2}, | |
{id: 3, status: true}, |
This file contains 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
// Given a value with a unit | |
// return the value without the unit | |
@function strip-unit($item) { | |
@if type-of($item) == 'number' and not unitless($item) { | |
@return $item / ( $item * 0 + 1 ); | |
} | |
@return $item; | |
} |
I hereby claim:
- I am dinocarl on github.
- I am dinocarl (https://keybase.io/dinocarl) on keybase.
- I have a public key ASDKE0ZRqX9N0qWa_W_hgF_DGsLmbgaWta9UtVWiQUAV2go
To claim this, I am signing this object:
This file contains 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
// meta-programming part | |
@mixin dynamicallyAvailableExtend($placeholder) { | |
%#{$placeholder} { | |
@content; | |
} | |
} | |
@mixin extend($placeholders...) { | |
@each $placeholder in $placeholders { | |
@extend %#{$placeholder}; |
This file contains 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
// use transducers | |
const appendTo = flip(append); | |
const apCh = (fn, accVal) => (item) => accVal = fn(accVal, item); | |
const steps = [ | |
filter(test(/[()]/)), | |
map((item) => item === '(' ? 1 : -1), | |
map(apCh(add, 0)), // scan transducer | |
]; |
This file contains 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 apCh = (fn, accVal) => (item) => accVal = fn(accVal, item); | |
const scanr = curry((fn, acc, xs) => map( | |
apCh(fn, acc), | |
xs | |
)) | |
scanr(add, 0)( | |
[5,6,7,8] | |
); |
This file contains 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 isntEmpty = complement(isEmpty); | |
const isntNil = complement(isNil); | |
const isntNaN = complement(isNaN); | |
const pageLens = lensProp('page'); | |
const numberValidations = [ | |
isntNaN, | |
isntNil, | |
isntEmpty, |