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
async function streamToString(stream: Readable) { | |
const chunks: Buffer[] = []; | |
for await (const chunk of stream) { | |
chunks.push(Buffer.from(chunk)); | |
} | |
return Buffer.concat(chunks).toString('utf-8'); | |
} |
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
# to be pasted into .bashrc or .zshrc | |
docker_image_platform() { | |
if [ -z "$1" ]; then | |
echo "Error: Please provide a Docker image name with version." | |
return 1 | |
fi | |
local image="$1" | |
local version=$(docker --version | awk '{print $3}' | tr -d ',') |
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
/** | |
* Creates a return value that is destructurable as both an object and an array. | |
* | |
* Usage example: | |
* | |
* ```ts | |
* const obj = createDualUseDestructurable({ foo, bar } as const, [ foo, bar ] as const) | |
* let { foo, bar } = obj | |
* let [ foo, bar ] = obj | |
* ``` |
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
{ | |
"index.html": { | |
"file": "assets/index.b5da49da.js", | |
"src": "index.html", | |
"isEntry": true, | |
"imports": [ | |
"_vendor.616da2c3.js" | |
], | |
"dynamicImports": [ | |
"@wilson/page-source/0/page/0", |
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
document.querySelectorAll('*').forEach(el => { | |
const cs = getComputedStyle(el) | |
//const zIndex = +cs.zIndex | |
//const aboveThreshold = zIndex > 100000 | |
if (cs.position === 'fixed') { | |
console.log(el) | |
el.style.cssText += ';position:static !important;' | |
} | |
if (cs.overflow === 'hidden') { | |
el.style.cssText += ';overflow:auto !important;' |
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
<Target Name="Build"> | |
<ZipDir | |
ZipFileName="MyZipFileName.zip" | |
DirectoryName="MyDirectory" | |
/> | |
</Target> | |
<UsingTask TaskName="ZipDir" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll"> | |
<ParameterGroup> | |
<ZipFileName ParameterType="System.String" Required="true" /> |
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
module.exports = { | |
config: { | |
fontSize: 14, | |
fontFamily: | |
'"Fira Code", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', | |
cursorColor: 'rgba(255,255,255,0.8)', | |
cursorShape: 'BEAM', | |
foregroundColor: '#fff', | |
backgroundColor: '#000', | |
borderColor: '#666', |
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
{ | |
"basePath": "/" | |
} |
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
sqrt(x) | |
if x == 0 | |
result = 0 | |
else | |
result = 4 | |
for i in (0..10) | |
result = ((result + (x / result)) / 2) | |
spring-noWobble(t) | |
return 2.71828 ** (-13 * t) * (2.71828 ** (13 * t) - 13 * sin(t) - cos(t)) |
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
#!/bin/bash | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
YELLOW='\033[0;33m' | |
NC='\033[0m' | |
if [ $# -eq 0 ] ; then | |
echo -e "${RED}Error: No port given${NC}" | |
exit 1 | |
fi |
NewerOlder