Skip to content

Instantly share code, notes, and snippets.

View wjt's full-sized avatar

Will Thompson wjt

View GitHub Profile
@hwayne
hwayne / explanation.md
Last active April 9, 2024 21:37
Sudoku DIMACS format

How the J Script Works

Going line by line:

b =: >: i. 9 9 9

This generates a 9 by 9 by 9 array with all values from 1 to 729. We can choose what each axis represents: I decided that each table is all of the boolean variables for one number, and the rows and columns map to sudoku rows and columns. For example:

@aparrish
aparrish / understanding-word-vectors.ipynb
Last active April 29, 2024 17:57
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aparrish
aparrish / spacy_intro.ipynb
Last active August 9, 2023 01:41
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dill
dill / all_the_single_palettes.txt
Last active November 11, 2015 16:21
👑🐝 All the single palettes 👑🐝 (one line per palette)
#273649 #647184 #B1B2C8 #A7755D #5D2E1C #38201C
#0F2B5F #5991C7 #8EC1E7 #B9DBF1 #D5A370 #7B4F37
#5A7362 #6B867C #A1A897 #9A8D6B #8E6341 #432B21
#1F150D #2B190C #513B2C #9B4D44 #893D37 #3E1B17
#9C8A45 #CABE85 #678B88 #9CADAF #CCCCCC #EFEFEF
#1C3333 #226060 #639CA4 #D2AD7C #BE7245 #46211C
#0D1723 #112040 #204D88 #96ABC6 #D1DDE2 #EFEFEF
#000000 #350E16 #5E1521 #A72C29 #C44221 #EC702E
#A56B47 #C79982 #0D8EDA #23ADED #6BC6F5 #EFEFEF
#2A2432 #4F3855 #846D86 #EFEFCF #D5B77D #A89E5E
@remy
remy / audiosprite.js
Created December 23, 2010 13:54
An example of how an audio sprite can be used (includes fixes for iOS)
function Track(src, spriteLength, audioLead) {
var track = this,
audio = document.createElement('audio');
audio.src = src;
audio.autobuffer = true;
audio.load();
audio.muted = true; // makes no difference on iOS :(
/* This is the magic. Since we can't preload, and loading requires a user's
input. So we bind a touch event to the body, and fingers crossed, the