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
<label for="browser">Choose your browser from the list:</label> | |
<input type="text" list="browsers" name="browser" id="browser" /> | |
<datalist id="browsers"> | |
<option value="Edge"></option> | |
<option value="Firefox"></option> | |
<option value="Google Chrome"></option> | |
<option value="Opera"></option> | |
<option value="Safari"></option> |
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
/** | |
* Returns parameters of a function | |
* Works for anonymous and named functions | |
* @param {Function} func | |
*/ | |
const getFunctionParams = (func: Function): string[] => | |
new RegExp('(?:\\s*|^)\\s*\\((.*?)\\)') | |
.exec(func.toString().replace(/\n/g, ''))![1] | |
.replace(/\/\*.*?\*\//g, '') | |
.replace(/ /g, '') |
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 call = | |
<A, B>(fn: (a: A) => B) => | |
(v: A): B => | |
fn(v) | |
const doCall = call((v: number) => { | |
return v.toString() | |
}) | |
const result = doCall(123) |
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 videoDoc = (id: string) => ({ | |
get() { | |
return { id } | |
}, | |
delete() {}, | |
}) | |
type QueryConstraint = number | |
const videosCollection = (...constraints: QueryConstraint[]) => ({ | |
observe() { |
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 node:12.21.0-alpine | |
# RUN apk update | |
RUN apk add curl bash python | |
RUN sudo curl -sL https://firebase.tools | bash | |
RUN curl -sL https://sentry.io/get-cli | bash | |
RUN curl https://sdk.cloud.google.com | --disable-prompts --install-dir=/home bash | |
ENV PATH $PATH:/home/google-cloud-sdk/bin |
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
gcloud meta list-files-for-upload |
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 proxify<T extends Object>(promise: Promise<T>): T { | |
const proxy = (path: Array<string> = []) => | |
new Proxy(() => {}, { | |
get: (_target, prop: string) => proxy([...path, prop]), | |
apply: (_, _this, argumentsList) => | |
promise.then((resolvedAPI) => | |
path | |
.reduce<any>((p, c) => p[c], resolvedAPI) | |
.apply(_this, argumentsList), |
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 childProcessExec = require('child_process').exec; | |
const util = require('util'); | |
const exec = util.promisify(childProcessExec); | |
checkCommitMessage(); | |
async function checkCommitMessage(){ | |
const branches = await exec('git branch'); | |
console.log(branches.stdout); |
NewerOlder