Skip to content

Instantly share code, notes, and snippets.

const a = { b: 1, toString: () => a.b++ };
console.log(a === 1 && a === 2 && a === 3) // True
@singiamtel
singiamtel / deploy
Created February 2, 2024 14:13
Basic deploy script to integrate with GH actions. Currently used in crob.at
#!/bin/bash
# Original author: https://github.com/pkmn/ai/blob/main/deploy
set -euxo pipefail
# Save our current commit to use for comparison later
HEAD=$(git rev-parse HEAD)
# Pull down latest code
{
"compilerOptions": {
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
@singiamtel
singiamtel / .eslintrc
Created February 2, 2024 13:48
Eslintrc start
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
@singiamtel
singiamtel / article.css
Created February 2, 2024 13:48
Default css for simple blog-like sites
/* https://gist.github.com/JoeyBurzynski/617fb6201335779f8424ad9528b72c41 */
html {
max-width: 70ch;
padding: 3em 1em;
margin: auto;
line-height: 1.75;
font-size: 1.25em;
}
h1,h2,h3,h4,h5,h6 {
@singiamtel
singiamtel / test_CPU_load.sh
Last active May 12, 2024 17:11
Bash script for stress testing a system by spawning multiple CPU-intensive processes. The script includes a signal handler to clean up any child processes before exiting. Useful for stress testing and space heating purposes
#!/bin/bash
cleanup() {
# Kill any child processes
echo "Cleaning up child processes..."
pkill -P $$
# Exit the script
exit 0
}