Skip to content

Instantly share code, notes, and snippets.

View aslilac's full-sized avatar
🦒
finally

Kayla Washburn-Love aslilac

🦒
finally
View GitHub Profile
@aslilac
aslilac / crc32.js
Last active August 20, 2021 09:10
A JavaScript/TypeScript CRC32 implementation in only 18 lines of code.
// Copyright 2019 McKayla Washburn
// MIT License
// Feel free to use this however you want for whatever you want.
// Just note that the function returns a signed 32 bit number.
// This is a limitation of JavaScript's bitwise operators.
// If the value you are checking against is unsigned, then you
// can convert it to a signed 32 bit number by doing a bitshift of 0.
// Ex:
@aslilac
aslilac / robertrussell.zsh-theme
Last active April 7, 2020 00:33
Better oh-my-zsh default theme
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[magenta]%}➜ )"
PROMPT='${ret_status} %{$fg[cyan]%}%~%{$reset_color%}$(git_prompt_info) '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
ZSH_THEME_GIT_PROMPT_DIRTY="$ZSH_THEME_GIT_PROMPT_CLEAN %{$fg[magenta]%}✗"
# graphics.py
"""Simple object oriented graphics library
The library is designed to make it very easy for novice programmers to
experiment with computer graphics in an object oriented fashion. It is
written by John Zelle for use with the book "Python Programming: An
Introduction to Computer Science" (Franklin, Beedle & Associates).
LICENSE: This is open-source software released under the terms of the
GPL (http://www.gnu.org/licenses/gpl.html).
@aslilac
aslilac / extract-aperture-images.js
Created August 9, 2012 23:19 — forked from rsms/extract-aperture-images.js
Aperture library extractor -- copies all source images from a apimportgroup inside a aplibrary into any folder.
#!/usr/bin/env node
// Aperture library extractor -- copies all source images from a apimportgroup inside a aplibrary
// into any folder.
//
// Step 1. Create a new folder somewhere, for instance in ~/ap-rescue
//
// Step 2. Run this program, giving it the apimportgroup as the first argument and your
// destination directory as the second argument.
//
// e.g. node extract-aperture-images.js ~/'Pictures/Aperture Library 2000.aplibrary/Arkivet.approject/2006-01-15 @ 03:57:21 PM - 1.apimportgroup' ~/ap-rescue
@aslilac
aslilac / nyan.js
Last active August 13, 2019 20:39
Nyan Hack
;(function ()
{
troubadourModeAchieved()
overNyanThousandAchieved()
var secs = prompt("How many seconds should I say you have nyaned for?"),
mute = confirm("I'm going to mute the audio."),
fire = confirm("I'm going to make the background change randomly.");
startTime.setTime( currentTime.getTime() - parseInt(secs) );