Skip to content

Instantly share code, notes, and snippets.

View singerng's full-sized avatar

Noah Singer singerng

View GitHub Profile
@singerng
singerng / kindle.py
Created November 1, 2022 18:32
Python script for parsing and ranking unknown words, using BeautifulSoup and NLTK
from bs4 import BeautifulSoup
from nltk.stem import SnowballStemmer
from nltk.corpus import cess_esp as corpus
from nltk import FreqDist
import csv
words = []
with open("kindle.html") as f:
soup = BeautifulSoup(f.read(), 'html.parser')
@singerng
singerng / commands.sh
Last active July 27, 2022 16:29
Useful commands for me to remember
# install tolerable version of ruby
# brew install rbenv
rbenv install 3.1.2 # lookup current ruby version
rbenv rehash
rbenv global 3.1.2
# merge pdfs in directory (sorted, so use numerical prefixes in order)
# brew install poppler
pdfunite *.pdf output.pdf
@singerng
singerng / zotero-config.js
Last active March 28, 2024 19:56
Export config script for Better BibTeX/LaTeX
function protectMath(text) {
if (text) return text.replace(/(\\\(.*?\\\))/g, '<script>{$1}</script>');
return "";
}
// wrap all latex in <script></script>
if (Translator.BetterTeX) {
if (reference.has.title) reference.add({ name: 'title', value: protectMath(item.title) });
if (reference.has.abstract) reference.add({ name: 'abstract', value: protectMath(item.abstract) });
@singerng
singerng / Django_Default_Config.md
Last active July 25, 2023 20:13
Config for Django/Pipenv/Gunicorn/Nginx/Systemd.

Reasonable default configuration for a web app that uses Django and the following dependencies:

  • Pipenv: Python package manager
  • Gunicorn: WSGI server
  • Nginx: Static webserver passing to gunicorn, handling SSL, etc.
  • Systemd: Used to load Gunicorn on startup

This is my goto for setting up projects.

Keybase proof

I hereby claim:

  • I am singerng on github.
  • I am singerng (https://keybase.io/singerng) on keybase.
  • I have a public key whose fingerprint is 6B8D A9D6 BF5D EBE7 CF71 A1FB 7A01 F3AB BC78 9C34

To claim this, I am signing this object: