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
def repeat_every(n = 10.seconds, timeout_in = 60.seconds) | |
begin | |
Timeout.timeout(timeout_in_seconds) do | |
loop do | |
yield false if block_given? | |
sleep n | |
end | |
end | |
rescue Timeout::Error |
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
/** | |
* @type {Function} | |
*/ | |
var toString = Object.prototype.toString; | |
/** | |
* @description Clones an object using deep copy | |
* | |
* @param {Object} sourceObject Object to clone | |
* @returns {Object} Cloned 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
/** | |
* Method takes a key and groups objects of an array | |
* (if running `groupCondition` on the object yields true) | |
* by the key passed. | |
* | |
* @param {string} key The key to group the object of the array by | |
* @param {function} groupCondition Function that is run on every | |
* object in the array and if it returns true, the object is then grouped | |
* | |
* @returns {array} Array of objects grouped by key |
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
Show hidden characters
{ | |
"compilerOptions": { | |
/* Basic Options */ | |
"target": "ES2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ | |
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ | |
"lib": ["es6"], /* Specify library files to be included in the compilation. */ | |
// "allowJs": true, /* Allow javascript files to be compiled. */ | |
// "checkJs": true, /* Report errors in .js files. */ | |
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ | |
// "declaration": true, /* Generates corresponding '.d.ts' file. */ |
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
# Logs | |
logs | |
*.log | |
npm-debug.log* | |
yarn-debug.log* | |
yarn-error.log* | |
# Runtime data | |
pids | |
*.pid |