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
navigator.mediaDevices.getDisplayMedia({video:true}).then(function(stream){ | |
const mr=new MediaRecorder(stream,{mimeType:"video/webm;codecs=h264,opus"}); | |
mr.ondataavailable=function(ev){ | |
const a=document.createElement('a');a.href=URL.createObjectURL(ev.data); | |
a.download ='screen_capture.webm';a.click(); | |
}; // will be called when .stop() with ev.data as a Blob | |
mr.start(); | |
}) |
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 puppeteer, { Page } from 'puppeteer'; | |
import dappeteer from '@chainsafe/dappeteer'; | |
import fs from 'fs'; | |
const METAMASK_SEED = '<your metamask seed>'; | |
const METAMASK_PASSWORD = '<your metamask password>'; | |
const collectionName = "<your collection name" | |
const collectionURL = `https://opensea.io/collection/${collectionName}/assets/create` |
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
{ | |
"editor.fontFamily": "Fira Code", | |
"editor.fontSize": 12, | |
"editor.tabSize": 2, | |
"editor.insertSpaces": true, | |
"editor.fontLigatures": true, | |
"workbench.editor.enablePreview": false, | |
"editor.formatOnSave": false, | |
"editor.defaultFormatter": "esbenp.prettier-vscode", | |
"[javascript]": { |
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
const ejs = require("ejs"); | |
const IntlMessageFormat = require("intl-messageformat").default; | |
const t = (str, obj) => new IntlMessageFormat(str).format(obj); | |
const data = { t: t, title: "hello world {name}" }; | |
const html = ejs.render("<%- t(title, {name: 'bot'}) %>", data); | |
console.log(html); |
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
<form action="/photos/upload" enctype="multipart/form-data" method="post"> | |
<input type="file" name="photos" multiple> | |
<input type="text" name="desc"> | |
<input type="submit" value="Submit"> | |
</form> |
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
# remove images by name | |
docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'imagename') | |
# check volume setting in container | |
docker inspect -f "{{ .Mounts }}" container_id | |
# check network name in container | |
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_id |
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 APPVERSION=`node -p "require('./package.json').version"` | |
echo $APPVERSION |
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 { createSlice, PayloadAction } from '@reduxjs/toolkit' | |
export type State = { | |
loading: boolean; | |
data: string; | |
} | |
export const initialState: State = { | |
loading: true, | |
data: '' |
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
{ | |
"arrowParens": "avoid", | |
"trailingComma": "none", | |
"jsxBracketSameLine": true, | |
"printWidth": 100, | |
"singleQuote": true, | |
"semi": false, | |
"tabWidth": 2 | |
} |
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
# png to jpg with width 100 | |
for i in *.png; do sips -s format jpeg -s formatOptions 90 -Z 100 $i --out "${i%png}jpg";done |
NewerOlder