Skip to content

Instantly share code, notes, and snippets.

@pnettto
pnettto / gist:7ccfffb35defdc00e5e164d628307247
Last active December 23, 2025 22:07
GCP Create small instance
gcloud compute instances create my-instance-name \
--zone=us-central1-a \
--machine-type=e2-micro \
--network-tier=STANDARD \
--image-family=debian-12 \
--image-project=debian-cloud \
--boot-disk-size=30GB \
--boot-disk-type=pd-balanced \
--tags=http-server,https-server \
--provisioning-model=STANDARD
@pnettto
pnettto / gist:7af9f449c7cfa1f4ff2a8ccebf727289
Created December 13, 2025 23:09
MOV to MP4 for the web
ffmpeg -i input.mov \
-vf "scale=1000:-2,fps=24" \ # Resize to 1000px wide (even height), reduce to 24fps
-c:v libx264 \ # Encode video using H.264 (best web compatibility)
-crf 26 \ # Quality setting (higher = smaller file, good for background videos)
-preset slow \ # Better compression efficiency (smaller size, slower encode)
-pix_fmt yuv420p \ # Use widely supported pixel format (Safari / mobile safe)
-movflags +faststart \ # Move MP4 metadata to front for instant streaming playbac
output.mp4
Optional
@pnettto
pnettto / gist:a0a514b8826d4ff1e4bbb9642cec451f
Created December 10, 2025 02:09
Interesting sites to check out
- https://rknight.me
- https://bobmonsour.com
- https://equk.co.uk
- https://claytonerrington.com
- https://simoncox.com
- https://bryanlrobinson.com
- https://michaelharley.net
- https://aleksandrhovhannisyan.com
- https://chriskirknielsen.com
- https://blog.martin-haehnel.de
$ code --list-extensions| xargs -L 1 echo code --install-extension
code --install-extension adpyke.codesnap
code --install-extension anthropic.claude-code
code --install-extension eseom.nunjucks-template
code --install-extension github.copilot
code --install-extension github.copilot-chat
code --install-extension inferrinizzard.prettier-sql-vscode
code --install-extension lumidew.claude-color-theme
code --install-extension mechatroner.rainbow-csv
@pnettto
pnettto / settings.json
Created December 5, 2025 15:21
VSCode settings
{
// Editor Formatting Settings
"[sql]": {
"editor.defaultFormatter": "inferrinizzard.prettier-sql-vscode"
},
"[xml]": {
"editor.defaultFormatter": "redhat.vscode-xml"
},
// Amazon Q telemetry
"amazonQ.telemetry": false,
[
// Terminal Shortcuts
{
// Toggle terminal visibility when Shift + Cmd + T is pressed
// Only works when terminal is already active
"key": "shift+cmd+t",
"command": "workbench.action.terminal.toggleTerminal",
"when": "terminal.active"
},
{
@pnettto
pnettto / functions.php
Created July 29, 2020 14:32
Surface Guntenberg Block in WP Rest API
<?php
// Surface all Gutenberg blocks in the WordPress REST API
function add_blocks_to_rest_api() {
$post_types = get_post_types_by_support([ 'editor' ]);
foreach ($post_types as $post_type) {
register_rest_field($post_type, 'blocks', [
'get_callback' => function (array $post) {
return parse_blocks($post['content']['raw']);
"""
This script takes a csv file exported from Google Spreadsheets
after getting answers from a Google Form, and displays the results
neatly in an Markdpown file. It also aggregates the results by one
column (in my case the question "Group name"), which you need to
specify in the group_column variable.
The answers.csv file (from Google Spreasheets) needs to be in the
same directory as this python script on run time.
"""
"""
Creates a CSV file to import passwords into BitWarden from an array
Usage:
- Download this file to a folder in your computer
- Change the file as you wish to add more account entries
- "cd" into the chosen download directory with the Terminal
- Run "python3 generate_bitwarden_import_file.py"
- A file called "generated_passwords.csv" will be created in the same directory
"""
This script generates a sidebar structure for Docsify (https://docsify.js.org/)
projects. It's intended as a way to make the sidebar a little more
straight-forward but the result will probably need some re-arranging.
Usage:
- Download this file to your project's directory
- "cd" into that directory
- Run "python3 generate_sidebar.py"