Skip to content

Instantly share code, notes, and snippets.

@jsomers
jsomers / android-websters.md
Last active April 20, 2024 01:15
Instructions for using Webster's 1913 on Android

To use Webster's 1913 dictionary on Android, install Colordict 3, an app that accepts this StarDict format. https://play.google.com/store/apps/details?id=com.socialnmobile.colordict

Next download James's S3 archive. https://s3.amazonaws.com/jsomers/dictionary.zip

You will need to extract the .dict file from inside three containers - .dz, .tar, .bz2 from innermost to outermost. 7zip handles all of these formats.

Place the .dict, .idx and .ifo files in the dictdata directory on your sdcard or local storage root. This is where colordict looks for dictionaries.

When the files are in the right place, you can run Colordict and tap the folder icon in the top right to see the dictionaries installed and set the dictionary priority. I put the 1913 dictionary above the defaults "Wordnet" and "Wikipedia." When you look up a word, ColorDict shows the definition, if available, from these multiple sources.

@jsomers
jsomers / a-wotd-custom-word-list.md
Last active October 23, 2023 20:20
How to use a custom word list with OS X's "Word of the Day" screensaver

OS X's "Word of the Day" screensaver is a great way to passively learn words:

But I've always thought that its word list kind of stunk—it was full of obscure words that I could never really see myself using. I'd prefer something like Norman Schur's 1000 Most Important Words. What if you could plug your own word list into the screensaver?

On a rather obscure comment thread, someone explained where you might find the word list that Apple uses to power the screensaver. It is at /System/Library/Graphics/Quartz\ Composer\ Plug-Ins/WOTD.plugin/Contents/Resources/NOAD_wotd_list.txt. The file looks like this:

m_en_us1282510	quinsy
@jsomers
jsomers / brahe.html
Last active August 16, 2023 06:54
Dynamically created sky map using Fourmilab's Your Sky
<script>
var toUrlParam = function(date) {
return date.toISOString().split("T")[0].replaceAll("-", "%2F");
}
// https://stackoverflow.com/questions/563406/add-days-to-javascript-date
Date.prototype.addDays = function(days) {
var date = new Date(this.valueOf());
date.setDate(date.getDate() + days);
return date;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jsomers
jsomers / websters-kindle.mdown
Created May 19, 2014 01:42
How to make the Webster's 1913 your default Kindle dictionary

How to make the Webster's 1913 your default Kindle dictionary

  1. Download a Kindle-compatible version of the dictionary here. Unzip the .rar archive.

  2. Get the "Send to Kindle" program on your computer. Here's the link for the Mac.

  3. Right-click your recently downloaded (unzipped) dictionary file, and click the "Send to Kindle" menu item. It will arrive on your Kindle shortly.

  4. Once the dictionary has arrived, go to your settings -- on my newish paperwhite, it's at Home > Settings > Device Options > Language and Dictionaries > Dictionaries > English. Choose the Webster's 1913.

@jsomers
jsomers / websockets.md
Created September 27, 2018 12:50
Using websockets to easily build GUIs for Python programs

Using websockets to easily build GUIs for Python programs

I recently built a small agent-based model using Python and wanted to visualize the model in action. But as much as Python is an ideal tool for scientific computation (numpy, scipy, matplotlib), it's not as good for dynamic visualization (pygame?).

You know what's a very mature and flexible tool for drawing graphics? The DOM! For simple graphics you can use HTML and CSS; for more complicated stuff you can use Canvas, SVG, or WebGL. There are countless frameworks, libraries, and tutorials to help you draw exactly what you need. In my case, this was the animation I wanted:

high-priority

(Each row represents a "worker" in my model, and each rectangle represents a "task.")

@jsomers
jsomers / websters-chrome.md
Created November 10, 2014 14:20
Adding Webster's as a Chrome search engine

Instructions courtesy of @chancelionheart:

  1. Access the Settings menu by clicking the Options icon in the upper-right corner of the browser window. It is the icon with three horizontal lines stacked on top of each other. Click on “Settings” near the bottom of the Options menu.

  2. Under the “Search” heading in the Settings menu, click the "Manage search engines" button.

  3. At the bottom of the Search Engines window that comes up, enter the following: Name: Use whatever you like (I used "Webster's Revised 1913+1928 Dictionary") Keyword: Also whatever you like, I just use 'd' for easy access. Url: http://machaut.uchicago.edu/?resource=Webster%27s&amp;word=%s&amp;use1913=on&amp;use1828=on (replaces the search term with %s, what google chrome uses for the query)

@jsomers
jsomers / college-squash.ipynb
Last active March 20, 2019 13:43
College Squash ratings analysis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jsomers
jsomers / traffic.ipynb
Created October 7, 2018 15:18
NYC traffic collision data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jsomers
jsomers / drive_google_doc.rb
Last active October 17, 2017 23:22
DocWriter code
# Dependencies: ruby-full, watir, xvfb, iceweasel, geckodriver
# Run `Xvfb :10 -ac &` before running this script
require 'watir'
NEW_DOC_URL = "https://docs.google.com/document/create"
EMAIL_ADDRESS = ENV['DOCWRITER_EMAIL']
PASSWORD = ENV['DOCWRITER_PASSWORD']
SHARE_WITH_EMAIL = ENV['DOCWRITER_SHARETO']