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 accumulator(callback){ | |
| let acc = [] | |
| let timeout = null | |
| return (val) =>{ | |
| acc.push(val) | |
| clearTimeout(timeout) | |
| timeout = setTimeout(() => { | |
| callback(acc) | |
| acc = [] |
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 createQueue() { | |
| const queue = []; | |
| let pendingPromise = false; | |
| function enqueue(callback) { | |
| queue.push(callback); | |
| dequeue(); | |
| } | |
| function dequeue() { |
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 fifo = limit => array => item => array.length === limit ? array.slice(1).concat(item) : array.concat(item) |
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
| // ==UserScript== | |
| // @name DesignMode toggler | |
| // @version 1 | |
| // @grant none | |
| // @include * | |
| // ==/UserScript== | |
| const shortcut = { | |
| key: '1', | |
| ctrlKey: 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
| // ==UserScript== | |
| // @name BRANCH_NAME_MAKER | |
| // @include https://qover001.atlassian.net/browse/* | |
| // @grant GM.setClipboard | |
| // ==/UserScript== | |
| const clickZone = document.createElement('div') | |
| clickZone.style = ` | |
| position: absolute; | |
| top: 15px; |
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 dataLayerDisplayer = document.createElement('div') | |
| dataLayerDisplayer.style= "font-size: 8; background-color: rgba(255,255,255,0.5); position: fixed; top:0; left: 0; z-index: 9001; max-height: 50vh; overflow: scroll;" | |
| dataLayerDisplayer.id = "dataLayerDisplayer" | |
| document.querySelector('body').append(dataLayerDisplayer) | |
| setInterval(() => document.querySelector('#dataLayerDisplayer').innerHTML = JSON.stringify(dataLayer.concat().reverse(), null, 2).split('\n').join('<br>').split(' ').join(' '), 500) |
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
| // usage: `node index-dot-js-maker.js <target directory>` | |
| const Promise = require('bluebird'); | |
| const fs = Promise.promisifyAll(require('fs')); | |
| const path = require('path'); | |
| const _ = require('lodash'); | |
| const cwd = process.cwd(); | |
| const maindir = path.resolve(cwd, process.argv[process.argv.length - 1]); |
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
| set smartindent | |
| set number | |
| set shiftwidth=2 | |
| set softtabstop=2 | |
| set tabstop=2 | |
| set expandtab |