Skip to content

Instantly share code, notes, and snippets.

Avatar
🦀
falling in love with a crab

Katie codehearts

🦀
falling in love with a crab
View GitHub Profile
View blm
╔═══*.·:·.☽✧ ✦ ✧☾.·:·.*═══╗
 black lives matter
╚═══*.·:·.☽✧ ✦ ✧☾.·:·.*═══╝
View pride
❄️✊🏾✊🏿🌹🌹🌹🌹🌹🌹🌹
🌸❄️✊🏾✊🏿🔥🔥🔥🔥🔥🔥
☁️🌸❄️✊🏾✊🏿☘️☘️☘️☘️☘️
🌸❄️✊🏾✊🏿💧💧💧💧💧💧
❄️✊🏾✊🏿☂️☂️☂️☂️☂️☂️☂️
View cmd2svg.sh
cmd2svg() {
name="$1"
shift
dest="$2"
shift
termtosvg -s "$dest" -g 80x20 -t gjm8 -c "$*"
mv "$dest"/termtosvg_00000.svg /mnt/"$name"
}
View moon.py
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
codehearts / pyglet_rectangle.py
Created Nov 18, 2018
Function to draw a rectangle using Pyglet
View pyglet_rectangle.py
import pyglet
def draw_rect(x, y, width, height):
pyglet.graphics.draw(4, pyglet.gl.GL_QUADS,
('v2f', [x, y, x + width, y, x + width, y + height, x, y + height]))
@codehearts
codehearts / checkpw.sh
Created Jun 13, 2018
Check a password against pwnedpasswords.com using k-anonymity
View checkpw.sh
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)"
suffixsha="${sha#$shortsha}"
breachcount="$(curl -s https://api.pwnedpasswords.com/range/$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
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>