Skip to content

Instantly share code, notes, and snippets.

View victoriadrake's full-sized avatar

Victoria Drake victoriadrake

View GitHub Profile
@victoriadrake
victoriadrake / get-hugo-extended.sh
Created May 5, 2024 18:59
Install the latest extended version of Hugo
sudo apt-get install jq
HUGO_VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | jq -r '.tag_name')
curl -sSL "https://github.com/gohugoio/hugo/releases/download/${HUGO_VERSION}/hugo_extended_${HUGO_VERSION:1}_linux-amd64.deb" -o hugo.deb
sudo dpkg -i hugo.deb
hugo version
@victoriadrake
victoriadrake / keygen.sh
Last active December 24, 2021 01:21
Generate ed25519 SSH Key
#!/bin/bash
# Generate the key
ssh-keygen -t ed25519
# Add it to the ssh-agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# Set appropriate permissions
chmod 600 ~/.ssh/id_ed25519
# Show the public key so you can copy it to GitHub
@victoriadrake
victoriadrake / .gitconfig
Last active October 7, 2021 22:24
Code Review Aliases for Git
[alias]
# Adapted from https://blog.jez.io/cli-code-review/
# List files which have changed since BASE
# Set BASE in shell configuration or before the command
files = !git diff --name-only $(git merge-base HEAD \"$BASE\")
# With stat for interactive use
stat = !git diff --stat $(git merge-base HEAD \"$BASE\")
# Put heatmap on your path:
@victoriadrake
victoriadrake / README.md
Created August 4, 2021 12:35
Minimal Machine

Minimal Machine

Quickly set up a new Linux (Debian, Ubuntu based) machine with minimal utilities for general work.

@victoriadrake
victoriadrake / commit-message-icons.txt
Last active May 22, 2021 13:54
Some opinionated emojis for iconizing commit messages.
🐣 Initial commit
📜 Add LICENSE
🖍 Minor edit
🔧 Fix *
🌱 Add *
@victoriadrake
victoriadrake / README.md
Created September 6, 2020 20:54
Render full image URLs in your Hugo site with a markup render hook

Render full image URLs in your Hugo site

This is a markup render hook for Hugo sites to change the behavior of image links in your built site. It should live at layouts/_default/_markup/render-image.html.

If the image link begins with http, the link will be rendered as-is.

If not, the page permalink will prefix the image URL to produce the full path to the image in the rendered site page.

@victoriadrake
victoriadrake / outrun.py
Last active July 19, 2020 15:42
🎠 Theme for powerline-shell
from powerline_shell.themes.default import DefaultColor
dark0 = 235
dark1 = 237
dark2 = 239
dark3 = 241
dark4 = 243
light0 = 229
light1 = 223
@victoriadrake
victoriadrake / lambda-rss-tweeter.go
Last active April 7, 2020 04:11
Tweet RSS feed links for AWS Lambda
package main
import (
"math/rand"
"net/url"
"os"
"time"
"github.com/ChimeraCoder/anaconda"
"github.com/Sirupsen/logrus"
```python
# Create the Checker class
class Checker:
# Queue of links to be checked
TO_PROCESS = Queue()
# Maximum workers to run
THREADS = 100
# Maximum seconds to wait for HTTP response
TIMEOUT = 60
@victoriadrake
victoriadrake / latency-numbers.md
Created February 28, 2020 17:00
Peter Norvig‘s Latency Numbers
Task Time
CPU execute typical instruction 1/1,000,000,000 sec = 1 nanosec
CPU fetch from L1 cache memory 0.5 nanosec
CPU branch misprediction 5 nanosec
CPU fetch from L2 cache memory 7 nanosec
RAM Mutex lock/unlock 25 nanosec
RAM fetch from main memory 100 nanosec
Network send 2K bytes over 1Gbps network 20,000 nanosec
RAM read 1MB sequentially from memory 250,000 nanosec