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
aeschli.vscode-css-formatter | |
ahmadawais.shades-of-purple | |
andys8.jest-snippets | |
asvetliakov.vscode-neovim | |
austenc.tailwind-docs | |
bierner.color-info | |
bmewburn.vscode-intelephense-client | |
bradlc.vscode-tailwindcss | |
burkeholland.simple-react-snippets | |
capaj.vscode-standardjs-snippets |
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
import AWS from 'aws-sdk' | |
import { UploadedFile } from 'express-fileupload' | |
import { | |
BeforeOperationHook, | |
BeforeValidateHook, | |
BeforeChangeHook, | |
AfterChangeHook, | |
BeforeReadHook, | |
AfterReadHook, | |
BeforeDeleteHook, |
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
// DEMO: https://observablehq.com/@richardvanbergen/flattening-arrays-of-things | |
function flatten(arr) { | |
let flatArr = [] | |
for (let num of arr) { | |
if (!Array.isArray(num) && !Number.isInteger(num)) { | |
throw new Error(`Input '${num}' is not an integer!`) | |
} | |
if (Array.isArray(num)) { |
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
export function flatten(inputArr) { | |
return inputArr.reduce((outputArr, input) => { | |
if (Array.isArray(input)) { | |
return outputArr.concat(flatten(input)) | |
} | |
outputArr.push(input) | |
return outputArr | |
}, []) | |
} |
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
exports.default = complete(grid) => { | |
// not really necessary but not a negative either, this function can just be init code at the top | |
createGrid = createGrid() => {} | |
// again, this function can be init code if you want it to be, not important | |
identifyMissing = identifyMissing() => {} | |
// now you don't have to pass around `grid` all the time, your functions aren't as pure but this isn't really | |
// a functional programming style anyway and it's fine in this instance to be honest | |
availableRow = availableRow(row, num) => {} |
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
/** | |
* With lodash | |
*/ | |
const fetchDestinationsFor = (city, excludeUncommon, sortFn) => { | |
const chain = _.chain(city) | |
.result('destinations', []) | |
.filter(excludeUncommon ? (x => x.common == true) : (x => true)) | |
.map(x => fetchBySlug(x.reference)) | |
.sortBy(sortFn || (x => true)); |
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(window, angular) { | |
'use strict'; | |
/** | |
* Register or fetch a module. Angular doesn't handle modules in this way usually, overriding the module instead of | |
* extending it. So controllers/services/directives/etc can't share the same namespace without separating the | |
* module definition from the module implementation, leading to files with one line in them or one file of module | |
* definitions. | |
* | |
* @param name {string} Module name. |
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
// earlier in the document | |
// cache DOM object lookups | |
$.app.elems = { | |
body: $('body'), | |
appContainer: $('#app-page'), | |
pages: $('.page'), | |
nav: $('#nav'), | |
focusInputs: $( | |
'select,' + |
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
-='cd -' | |
..='cd ..' | |
...='cd ../..' | |
1='cd -' | |
2='cd +2' | |
3='cd +3' | |
4='cd +4' | |
5='cd +5' | |
6='cd +6' | |
7='cd +7' |