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" |
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
// Newlines, tabs and non-printable unicode characters | |
private static final String sanitizePattern = "(\\r|\\n|\\t|\\p{C})"; | |
private static final String whitespacePattern = " +"; | |
private static final String replacementString = " "; | |
private static String sanitize(String text) { | |
return text.replaceAll(sanitizePattern, replacementString); | |
} |
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
{ | |
"editor.tabSize": 2, | |
"editor.renderWhitespace": "none", | |
"workbench.iconTheme": "vs-seti", | |
"editor.minimap.enabled": true, | |
"terminal.integrated.shell.windows": "c:\\windows\\system32\\cmd.exe", | |
"terminal.integrated.shellArgs.windows": [ | |
"/k", | |
"c:\\program files\\git\\bin\\bash.exe" | |
], |
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
Dir | Rename-Item –NewName { $_.name.replace(' ','_') -replace '[()]','' } |