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
| type NullPartial<T> = { | |
| [P in keyof T]?: T[P] | null; | |
| }; | |
| type Optional<T, K extends keyof T> = Omit<T, K> & NullPartial<T>; | |
| function withOptional<TProps, TOpts extends Array<keyof TProps>>( | |
| Wrapped: ComponentType<TProps>, | |
| optionals: TOpts, | |
| Placeholder: ComponentType<Optional<TProps, TOpts[number]>>, | |
| ): ComponentType<Optional<TProps, TOpts[number]>> { |
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
| #### apply .nvmrc if exists | |
| p=$(realpath .) | |
| t=".nvmrc" | |
| until [ $p = '/' ]; do | |
| if [ -f $p/$t ]; then | |
| nvm use | |
| break | |
| fi | |
| p=$(realpath $p/..) | |
| done |
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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <script> | |
| (function (paramName, url) { | |
| function hrefWithoutHash(anchor) { | |
| var hashLength = anchor.hash.length; | |
| return anchor.href.substring(0, anchor.href.length - hashLength); | |
| } |
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
| [ | |
| "Some value", | |
| "Another value", | |
| "More values" | |
| ] |
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
| ====== Request =================== | |
| GET https://graph.microsoft.com/v1.0/me/onenote/pages/1-3e7c1460680d4fe28501792ccda64915!119-304d54d6-d499-49f0-b231-cb3a9248e4e9/content?includeIDs=true | |
| ====== Response: Headers =================== | |
| Cache-Control: private | |
| Transfer-Encoding: chunked | |
| Content-Type: text/html; charset=utf-8 | |
| ETag: "{b98bb127-0abe-02cc-2762-7864574b8342}{1}" | |
| request-id: 17234428-8bb8-4937-b197-f1c605e39aa1 | |
| client-request-id: 17234428-8bb8-4937-b197-f1c605e39aa1 |
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
| { | |
| "requests": [ | |
| { | |
| "id": "1", | |
| "method": "PATCH", | |
| "url": "/me/onenote/pages/{{ pageId }}/content", | |
| "body": { | |
| "value": [ | |
| { | |
| "action": "insert", |
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
| <html lang="en-US"> | |
| <head> | |
| <title>One more list</title> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <meta name="created" content="2018-09-24T13:29:00.0000000" /> | |
| </head> | |
| <body data-absolute-enabled="true" style="font-family:Calibri;font-size:11pt"> | |
| <div id="div:{3e7c1460-680d-4fe2-8501-792ccda64915}{186}" style="position:absolute;left:48px;top:115px;width:624px"> | |
| <ul id="ul:{3e7c1460-680d-4fe2-8501-792ccda64915}{186}"> |
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
| // nodejs v8.9.4 | |
| // yarn add evernote@2.0.5 | |
| const Evernote = require('evernote'); | |
| const client = new Evernote.Client({ token: 'put-your-token-here', sandbox: false }); | |
| const store = client.getNoteStore(); | |
| process.on('uncaughtException', (err) => { | |
| console.log({ source: 'uncaughtException', err }); | |
| process.exit(1); | |
| }); |
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 moo = require('moo'); | |
| const Time = require('./time'); | |
| const parser = moo.compile({ | |
| VAR: { | |
| match: /{[a-zA-Z_]\w*}/, | |
| keywords: { PREDEF: ['{today}'] } // predefined keywords | |
| }, | |
| OP: ['and', 'or', '+', 'at'], | |
| DAY: { |
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
| CERTS_PATH="/path/to/certs" | |
| HOST="my.example.com" | |
| EMAIL="email@example.com" | |
| DOCKER_SOCK="/var/run/docker.sock" | |
| docker run \ | |
| --name nginx-proxy \ | |
| --detach=true \ | |
| --publish 80:80 \ | |
| --publish 443:443 \ |