Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1b - Decimal:
27
| /* | |
| <https://stackoverflow.com/questions/40296831/is-it-possible-to-force-a-copy-of-a-protected-google-doc> | |
| NOTE - 2021-05-24 | |
| ----------------- | |
| The script below isn't the fastest way to copy-and-paste from a protected | |
| Google Doc. Before trying it, I'd suggest following MikoFrosty's advice from | |
| the comments: |
| const https = require('https'); | |
| const fs = require('fs'); | |
| /** | |
| * | |
| * @param {string} url | |
| * @param {string} dest | |
| * @example | |
| * (async () => { | |
| * await download('https://img.alicdn.com/imgextra/i1/O1CN01MJQUsF1ag0hxvreSe_!!6000000003358-2-tps-1280-1120.png', 'a.png'); |
| const firstLetterCase = (obj, upperCase) => { | |
| const process = (object, memo) => { | |
| if (isObject(object)) { | |
| Object.keys(object).forEach((key) => { | |
| const firstLetter = upperCase ? key[0].toUpperCase() : key[0].toLowerCase(); | |
| const newKey = `${firstLetter}${key.substr(1, key.length - 1)}`; | |
| let copy = object[key]; |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" | |
| content="width=device-width, initial-scale=1.0"> | |
| <title>Render Svg file</title> | |
| <style> | |
| * { | |
| margin: 0; |
.bash_profilesudo vim ~/.bash_profileHOMEBREW_NO_AUTO_UPDATE=1export HOMEBREW_NO_AUTO_UPDATE=1
| (function() { | |
| 'use strict'; | |
| let style = document.createElement('style'); | |
| style.innerHTML = '*{ user-select: auto !important; }'; | |
| document.body.appendChild(style); | |
| })(); |
| function memoize(fun) { | |
| if (!memoize.equalCheck) { | |
| memoize.equalCheck = function (prevArgs, nextArgs) { | |
| if (prevArgs === null || prevArgs === null || prevArgs.length !== prevArgs.length) { | |
| return false | |
| } | |
| const length = prevArgs.length; | |
| for (let index = 0; index < length; index++) { | |
| if (prevArgs[index] !== nextArgs[index]) { | |
| return false; |
| const base64 = { | |
| encode(str){ | |
| return Buffer.from(str).toString('base64'); | |
| }, | |
| decode(str){ | |
| Buffer.from(str, 'base64').toString() | |
| } | |
| }; |
| funciton getDateRangeString(startDate, endDate){ | |
| let result = []; | |
| while (startDate.isBefore(endDate)) { | |
| result.push(startDate.format("YYYY-MM-01")); | |
| startDate.add(1, 'month'); | |
| } | |
| return result; | |
| } |