Skip to content

Instantly share code, notes, and snippets.

falling in love with a crab

Katie codehearts

falling in love with a crab
View GitHub Profile
View blm
╔═══*.·:·.☽✧ ✦ ✧☾.·:·.*═══╗
 black lives matter
╚═══*.·:·.☽✧ ✦ ✧☾.·:·.*═══╝
View pride
cmd2svg() {
termtosvg -s "$dest" -g 80x20 -t gjm8 -c "$*"
mv "$dest"/termtosvg_00000.svg /mnt/"$name"
class Moon(object):
"""Graphical moon object"""
PHASES = ('new', 'waxing-crescent', 'first-quarter', 'waxing-gibbous',
'full', 'waning-gibbous', 'third-quarter', 'waning-crescent')
def __init__(self, x, y):
"""Creates a new moon at the coordinates"""
self._x, self._y = x, y
codehearts /
Created Nov 18, 2018
Function to draw a rectangle using Pyglet
import pyglet
def draw_rect(x, y, width, height):,,
('v2f', [x, y, x + width, y, x + width, y + height, x, y + height]))
codehearts /
Created Jun 13, 2018
Check a password against using k-anonymity
checkpw() {
local pw sha shortsha suffixsha breachcount
read -srp '> ' pw
sha="$(echo -n "$pw" | sha1sum | cut -d' ' -f1)"
shortsha="$(echo -n "$sha" | cut -c-5)"
breachcount="$(curl -s$shortsha | grep -i $suffixsha | cut -d':' -f2)"
View jot.vim
" Jot
" Author: Kate Hart
" Colors:
" Background: #f9ffff
" Normal: #262626
" Light: #b6b6b6
" Highlight: #0c9cf0
" Light: #e4ecf0
" Dark: #0e5591
codehearts / forkonacci.c
Last active Oct 16, 2015
Poking fun at how recursion is taught as the holy grail of CS in entry-level courses.
View forkonacci.c
* Poking fun at how recursion is taught as the holy grail in entry-level CS.
* This forks a process for each recursive computation and uses the return
* status as the return value.
* Running this might be a really bad idea!
#include <unistd.h>
#include <stdlib.h>