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
meta |
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
tell application "Microsoft Outlook" | |
repeat with calendarEvent in the every calendar event | |
accept meeting calendarEvent | |
end repeat | |
end tell |
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
Find: | |
function ([a-zA-Z]+)(\([a-zA-Z, \{\}]+\)) (\{) | |
Replace: | |
const $1 = $2 => $3 |
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
/* eslint-disable no-console, no-param-reassign */ | |
/** | |
* Returns a filled in board such that there are no 3 consecutive | |
* jewels (vertically/horizontally) of the same type. | |
* | |
* @param widthOfBoard int which provides width of board | |
* @param heightOfBoard int which provides height of board | |
* @param jewels array providing valid jewels for board | |
*/ |
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
const console = require("console"); | |
(function () { | |
console.log(foo); // undefined | |
{ | |
var foo = 'foo'; | |
} | |
})(); | |
(function () { |
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
function isArrayPalindrome (array) { | |
const forward = [...array].join(); | |
const reversed = [...array].reverse().join(); | |
if (reversed == forward) { | |
return true; | |
} | |
return false; | |
} | |
const getArraySansIndex = (a, _index) => a.filter((item, index) => index !== _index); |
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
#!/usr/bin/env node | |
const argv = require('yargs-parser')(process.argv.slice(2)); | |
function getEnvVarForScopeVConfigKey(keyName) { | |
const {env} = require('process'); | |
return env[`MONOREPO_${keyName.toUpperCase()}`]; | |
} | |
const ScopeVConfiguration = Object.create({ |
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
/* Begin cache-related code */ | |
const sumCache = new Map(); | |
function getCachedSumResult (array, sum) { | |
return sumCache.get(`${array}{${sum}`); | |
} | |
function cacheSumResult (array, sum, result) { | |
sumCache.set(`${array}{${sum}`, result); | |
return result; |
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
const fetch = require('node-fetch'); | |
function classFetch (classId) { | |
return fetch(`https://api.managebac.com/v2/classes/${classId}/students`, { | |
headers: { | |
'auth-token': '{{}}' | |
} | |
}) | |
.then(response => | |
response.json() |
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
> foo = (...s) => `foo${s.join()}` | |
[Function: foo] | |
> bar = (...s) => `${s.join()}bar` | |
[Function: bar] | |
> qux = s => Math.ceil(Number(s)) | |
[Function: qux] | |
> compose(foo, bar, qux)(1.27890) | |
'foo2bar' | |
> fooBarQux = compose(foo, bar, qux) | |
undefined |