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
| // via https://yeun.github.io/open-color/ | |
| const palette = { | |
| dark: [ | |
| '#d5d7e0', | |
| '#acaebf', | |
| '#8c8fa3', | |
| '#666980', | |
| '#4d4f66', | |
| '#34354a', |
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
| /* Append arguments to functions */ | |
| function appendArguments(fn, append, context) { | |
| if (!append) return fn | |
| // console.log('context', context) | |
| return function () { | |
| /* Original args */ | |
| const args = Array.prototype.slice.call(arguments) | |
| // console.log('original args', arguments) | |
| /* Create clone of args */ |
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
| var regexMdLinks = /(?:['"(])((?:\/|https?:\/\/)[\w\d./?=#%+&]+)/gmi | |
| // Example md file contents | |
| var mdContents = ` | |
| Lorem ipsum dolor sit amet, consectetur adipiscing elit.. | |
| [hello link](/admin/table_edit/table_edit.cfm?action=edit&table_name=organizationsXcategories) | |
| Lorem ipsum dolor sit amet, consectetur adipiscing elit.. |
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 getMethods(obj) { | |
| const excludeBuiltIns = Object.getOwnPropertyNames(Object.prototype) | |
| let properties = new Set() | |
| let currentObj = obj | |
| do { | |
| Object.getOwnPropertyNames(currentObj).map(item => properties.add(item)) | |
| } while ((currentObj = Object.getPrototypeOf(currentObj))) | |
| return [ | |
| ...properties.keys() | |
| ].filter((item) => { |
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
| // via https://github.com/idleberg/web-porridge/blob/7d43f9cd01a2e7ad902b0ce37045e38a187fe118/src/util.ts | |
| /** | |
| * Checks whether input data requires deserialization after reading it from WebStorage | |
| * @param {*} inputData | |
| * @returns {boolean} | |
| */ | |
| function maybeDeserialize(inputData): boolean { | |
| const serializables = [ | |
| '[object Array]', |
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
| /* | |
| "csv-parse": "^4.15.3", | |
| "follow-redirects": "^1.13.3", | |
| */ | |
| const path = require('path') | |
| const fs = require('fs').promises | |
| const parse = require('csv-parse') | |
| const { https } = require('follow-redirects') | |
| const parseFullName = require('./src/utils/parse-name') |
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 cleanBooleanParam(value) { | |
| switch(value.toString().toLowerCase()) { | |
| case "true": | |
| case "on": | |
| case "yes": | |
| case "1": | |
| return true; | |
| case "false": | |
| case "off": | |
| case "no": |
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
| // From https://github.com/sw-yx/swyxdotio/blob/60b088cea0439d3e2536a78dc922af3146ba40fd/screenshot-plugin/screenshot.js | |
| const puppeteer = require('puppeteer') | |
| const fs = require('fs') | |
| const path = require('path') | |
| module.exports = screenshot | |
| async function screenshot(PostArray) { | |
| const headless = true | |
| // const headless = false // for debug | |
| const browser = await puppeteer.launch({ headless }) |
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
| const path = require('path') | |
| const fs = require('fs') | |
| const globby = require('globby') | |
| const cp = require("child_process") | |
| function installDeps(functionDir, cb) { | |
| cp.exec("npm i", { cwd: functionDir }, cb) | |
| } | |
| async function installAllDeps(additionalDirs = []) { |
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
| const pattern = /^(?:\S+:\/\/)?(?:\S+@)?(?'host'\S+?)[:\/](?'owner'\S+?)[\/](?'repository'\S+)$/gm | |
| /* | |
| https://github.com/rawkode/dotfiles | |
| https://github.com/rawkode/dotfiles/2 | |
| [email protected]:rawkode/dotfiles | |
| [email protected]:rawkode/dotfiles/micro/1/2 | |
| ssh://[email protected]/rawkode/dotfiles |