Skip to content

Instantly share code, notes, and snippets.

View audy's full-sized avatar
🔬

Austin Richardson audy

🔬
View GitHub Profile
@joeycastillo
joeycastillo / bluemarble.py
Created August 1, 2020 20:12
Display real-time GOES-East imagery on a Waveshare 7-color EPD
# Based on Waveshare's epd5in65f.py demo. Copyright notice at end.
import sys
import os
picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic')
libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
if os.path.exists(libdir):
sys.path.append(libdir)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tomsing1
tomsing1 / eutils.md
Created November 22, 2018 19:04
Notes on using NCBI eutils

All requests start with this URL: https://eutils.ncbi.nlm.nih.gov/entrez/eutils/

  • Use lowercase characters for all parameters except &WebEnv.
  • Special characters, such as quotation marks (“) or the # symbol used in referring to a query key on the History server, should be represented by their URL encodings (%22 for ; %23 for #).
  • If a space is required, use a plus sign (+) instead of a space:
Incorrect: &id=352, 25125, 234
Correct: &id=352,25125,234
@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.")

@raineorshine
raineorshine / human-readable-hash-comparisons.md
Last active April 26, 2024 13:52
An aesthetic comparison of a few human-readable hashing functions.

An Aesthetic Comparison of Human-Readable
Hashing Functions

The following compares the output of several creative hash functions designed for human readability.

sha1's are merely used as arbitrary, longer, distributed input values.

input 1 word output 2 word output 3 word output
@karpathy
karpathy / min-char-rnn.py
Last active May 10, 2024 18:13
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@leeper
leeper / power.R
Last active August 29, 2015 14:23
Statistical Power
# effect sizes
d <- seq(.01, 2, length.out = 1000)
# required sample size at different power levels
n50 <- sapply(x, function(x) power.t.test(n = NULL, delta = x, power = 0.50)$n)
n80 <- sapply(x, function(x) power.t.test(n = NULL, delta = x, power = 0.80)$n) # conventional
n90 <- sapply(x, function(x) power.t.test(n = NULL, delta = x, power = 0.90)$n)
n95 <- sapply(x, function(x) power.t.test(n = NULL, delta = x, power = 0.95)$n)
n99 <- sapply(x, function(x) power.t.test(n = NULL, delta = x, power = 0.99)$n)
@janko
janko / 01-activerecord.rb
Created May 27, 2015 22:50
PostgreSQL JSON querying in Sequel (my presentation from our local Ruby meetup)
require "active_record"
ActiveRecord::Base.establish_connection('postgres:///testing')
ActiveRecord::Migration.verbose = false
ActiveRecord::Migration.class_eval do
create_table :played_quizzes, force: true do |t|
t.integer :player_ids, array: true
t.json :quiz_snapshot
end
@MasterofJOKers
MasterofJOKers / gateway.py
Created November 29, 2014 20:06
vanilla Minecraft server to IRC chat gateway
"""
Prerequisites:
* pyinotify (python-pyinotify on debian)
* irc (python-irc on debian (jessie and later - otherwise via virtualenv))
* start the minecraft server like this:
$ echo > input.log
$ tail -f input.log 2>/dev/null | java -server -X bla -jar minecraft_server.jar nogui &
$ cat >> input.log
* stop minecraft like this:
stop

how to read and post usenet stuff on tilde.town

  1. run "alpine"
  2. press "s" for Setup
  3. press "c" for Configure
  4. arrow down to "NNTP Servers" and hit enter
  5. input "tilde.town" and hit enter
  6. hit "e" for Exit
  7. hit "y" to save configuration change
  8. You should be back at the main menu. Select "Folder list"