Skip to content

Instantly share code, notes, and snippets.

@sunfarm
sunfarm / Makefile
Created October 20, 2020 17:12
Python Django getting started Makefile
# mkdir django && cd django
default:
@sunfarm
sunfarm / .gitconfig
Last active March 30, 2019 15:16
Git config
# Some of these commands are pretty esoteric and may not make sense to others. Feel free to ask me about them though!
[user]
# name = YOUR_NAME
# email = YOUR_EMAIL
[push]
default = simple
[alias]
### Branching ###
# Rebuild a release branch. Silently fails if not named properly
@sunfarm
sunfarm / thisdir.sh
Last active September 13, 2022 16:15
#!/bin/bash
# thisdir -- save your bash history in the currect working directory
# @author: Nathanael Raway <nathanael.raway@gmail.com>
# ----- WARNING -----
# This is a work in progress. Use at your own risk.
# You may want to save your bash history file before trying
# cp ~/.bash_history ~/.bash_history.backup
@sunfarm
sunfarm / tricks-treats-macos.bash
Created October 28, 2017 13:57
MacOS Tricks/Treats
# Disable spotlight indexing for a particular path
sudo mdutil -i off "/Volumes/$DRIVE"
# Generate valid, albeit trivial, json of a specific length
python -c 'print("[\"" + "x" * 1000 + "\"]")'
# Count the lines in a file and delete it (fugetabowtit!)
wc -l < $(ls export_* | tail -1) | pbcopy; rm export_*
grep lol /usr/share/dict/words
@sunfarm
sunfarm / jumble.py
Last active October 19, 2017 12:33
# Python 3
import sys
import string
import random
if len(sys.argv) < 2:
print('Need a source string!')
exit()
@sunfarm
sunfarm / random-string.lua
Created August 4, 2017 13:32
Generate a pseudo-random string in Lua
-- Generate a pseudo-random string
-- If this is run more than once in the same second given by os.time(), it will generate the same string
local chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+-={}|[]`~'
local length = 40
local randomString = ''
math.randomseed(os.time())
charTable = {}
@sunfarm
sunfarm / keybase.md
Created February 9, 2017 16:21
Keybase claim

Keybase proof

I hereby claim:

  • I am sunfarm on github.
  • I am sunfarm (https://keybase.io/sunfarm) on keybase.
  • I have a public key ASCNs8SyYVPeT8mDC469D5Xy-Xm2QgXUMKkeYf7Dml8-PQo

To claim this, I am signing this object: