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 uniqueReducer(unique, item) { | |
return unique.includes(item) ? unique : [...unique, item]; | |
} | |
function mergeObjectsReducer(accumulator, current) { | |
return { | |
...accumulator, | |
...Object.keys(current) | |
.filter( | |
key => |
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
Start-Process "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ` | |
-ArgumentList "--remote-debugging-port=9222",` | |
"--enable-features=`"dns-over-https<DoHTrial`"",` | |
"--force-fieldtrials=`"DoHTrial/Group1`"",` | |
"--force-fieldtrial-params=`"DoHTrial.Group1:server/https%3A%2F%2F1.1.1.1%2Fdns-query/method/POST`"" |
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 retry from "async-retry"; | |
const retryOptions = { | |
forever: true, | |
factor: 2 | |
}; | |
export default (url, options) => retry(async () => { | |
const response = await fetch(url, options); | |
if (response.status !== 200) { |
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
export const sumObjects = (first, second) => Object.keys(second).reduce((object, key) => ({ | |
...object, | |
[key]: (first[key] || 0) + (second[key] || 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
export const findInObject = (combinedPath, object, separator = ".") => { | |
if (combinedPath === undefined) { | |
return undefined; | |
} | |
const path = combinedPath.split(separator); | |
return path.reduce((accumulator, value) => ((accumulator && accumulator[value] !== undefined) ? accumulator[value] : undefined), object); | |
}; |
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
/** | |
* 1D noise generator function. | |
* Inspired by https://codepen.io/Tobsta/post/procedural-generation-part-1-1d-perlin-noise | |
* | |
* @param {string} seed Initializes the pseudorandom number generator (default empty) | |
* @param {number} width Total number of points in the generated noise line (default 1) | |
* @param {number} amplitude Height of the wave (default 128) | |
* @param {number} wavelength Distance between the peaks of each wave (default 128) | |
* @param {number} octaves How many noise lines will be combined together (default 8) | |
* @param {number} divisor Number by witch each noise line will be divided (default 2) |
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
setInterval(function() { | |
document.getElementsByClassName('pl-video-edit-remove')[0].click(); | |
}, 2000); |
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
// Place your settings in this file to overwrite the default settings | |
{ | |
"terminal.integrated.shell.windows": "c:\\windows\\system32\\cmd.exe", | |
"terminal.integrated.shellArgs.windows": [ | |
"/k", | |
"c:\\program files\\git\\bin\\bash.exe" | |
], | |
"editor.minimap.renderCharacters": false, | |
"extensions.ignoreRecommendations": false, | |
"git.autofetch": 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
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
const GitHub = require('github-api'); | |
const gh = new GitHub(); | |
const me = gh.getUser('hperantunes'); | |
me.listStarredRepos((err, repos) => { |
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
alias meteor="cmd //c meteor" |