Skip to content

Instantly share code, notes, and snippets.

View garfieldnate's full-sized avatar

Nathan Glenn garfieldnate

View GitHub Profile
adtac / Dockerfile
Last active May 28, 2024 01:38
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
RUN npm install sqlite3
lucataco /
Last active December 16, 2023 10:51
Clean Ubuntu Install - Machine Learning setup
# Install Ubuntu 22.04
sudo apt-get update
sudo apt-get upgrade -y
# Install ssh, curl, git, htop
sudo apt install openssh-server
sudo apt install curl git htop zstd
# Install CUDA toolkit 12.1 drivers
Nexarian /
Last active July 22, 2024 11:45
Setup for XRDP using Nvidia Acceleration
#!/usr/bin/env bash
set -e
cd ~
sudo -v
# Make sure system is in a good, updated, clean, state.
sudo apt-get -y update
fasiha /
Last active April 7, 2023 14:15
How Anki calculates intervals

Reading _nextRevIvl and its subfunction _constrainedIvl plus _rescheduleLapse will illuminate how Anki calculates the due date (the “interval”) of a flashcard, based on whether you answer

  • 1 (fail)
  • 2 (pass but hard)
  • 3 (pass)
  • 4 (pass and easy)

This is more of a self-note, so I assume you’ve read the Anki manual top-to-bottom a couple of times.

Let d >= 0, “delay”, be the days between the due date and the date you actually reviewed. This can be important because if you successfully answer a flashcard a long time after it was due for study, that means you probably know it really well.

tomysmile /
Last active July 16, 2024 04:45
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
bishboria /
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
0XDE57 /
Last active July 7, 2024 00:25
Firefox about:config privacy settings


about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
// query(term | [term, term, ...], term | [term, term, ...], ...)
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )
rshipp /
Last active March 23, 2023 12:17
Scrape the highest rated MP3 from for a given word
# Forvo scraper
if [[ -z $word ]]; then
echo "usage: "
echo "FORVO_LANG=languagecode ./ myword"
acdha /
Created June 12, 2015 22:32
Ways to get the name of a Unicode block for a character in Python
#!/usr/bin/env PYTHONIOENCODING=utf-8 python
# encoding: utf-8
from __future__ import absolute_import, print_function, unicode_literals
import os
import re
import requests