A Pen by Olivia Osby on CodePen.
A Pen by Olivia Osby on CodePen.
A Pen by Olivia Osby on CodePen.
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 curryMe(x, y, z) { | |
| return x / y * z; | |
| }; | |
| function currier() { | |
| var f = Array.prototype.shift.call(arguments); | |
| var a = Array.prototype.slice.call(arguments); | |
| function maker () { | |
| var b = Array.prototype.slice.call(arguments), | |
| c = a.concat(b); |
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
| var Graph = React.createClass({ | |
| displayName: 'graphWidget', | |
| getDefaultProps() { | |
| return { | |
| backgroundColor: 'aliceblue', | |
| canvasHeight: 200, | |
| canvasWidth: 200, | |
| clickThreshold: 10, | |
| colorMatrix: { |
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
| <snippet> | |
| <content><![CDATA[ | |
| gulp.task('${1}', function(){ | |
| gulp.${2:src}(${3}) | |
| .pipe(${4}); | |
| }); | |
| ]]></content> | |
| <!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
| <tabTrigger>gt</tabTrigger> | |
| <!-- Optional: Set a scope to limit where the snippet will trigger --> |
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 mutationObserver = new MutationObserver((e) => { | |
| if (e[0].removedNodes) { | |
| console.log('%cremoved nodes %o', 'color:aquamarine', e[0].removedNodes); | |
| } | |
| }); | |
| // watch just the child nodes | |
| mutationObserver.observe(document.querySelector('main'), { childList: true }); |
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 singletonMaker(key, klassname, namespace) { | |
| if (!window[namespace]) { | |
| window[namespace] = {}; | |
| } | |
| const keySymbol = Symbol.for(key); | |
| const globalSymbols = Object.getOwnPropertySymbols(namespace); | |
| const hasKey = (globalSymbols.indexOf(keySymbol) > -1); | |
| if (!hasKey) { |
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 enummaker(obj = {}) { | |
| let newEnum = obj; | |
| newEnum[Symbol.iterator] = function() { | |
| let i = 0; | |
| let keys = Object.keys(this); | |
| return { | |
| next: function() { | |
| let value = keys[i]; | |
| i++; |
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 { SOME_VALUE } from '../constants'; | |
| jest.mock('../constants', () => ({ SOME_VALUE: 'abc123test' })); |
OlderNewer