Skip to content

Instantly share code, notes, and snippets.

@privong
privong / speed-vs-cadence.rkt
Last active August 19, 2019 01:46
Compute a plot speed as a function of cadence for different gear ratios
#lang racket/base
(require plot)
; gearing specifications
(define crings (list 36 48))
(define cassette (list 12 13 14 15 17 19 21 23 25))
; wheel circumference in km
(define wheelc (/ 2190 1e6))
@privong
privong / gist:ec1e0835078a262870612031e3bc3ecb
Created October 25, 2017 14:40
eduroam netctl config for the University of Florida
Connection=wireless
Interface=your-interface-name
Security=wpa-configsection
Description="eduroam"
IP=dhcp
TimeoutWPA=10
ESSID=eduroam
WPAConfigSection=(
'ssid="eduroam"'
'proto=WPA2'
@privong
privong / lmst.c
Last active March 10, 2023 02:59
Calculate and print local mean sidereal time
/* lmst.c
*
* Compute and return the LMST, based on the current time and an input
* longitude.
*
* Equations from:
* https://www.cv.nrao.edu/~rfisher/Ephemerides/times.html
*
* George C. Privon
*
@privong
privong / sismologia.py
Last active September 18, 2015 16:52
sismologia.cl scraper for recent earthquakes
#!/usr/bin/env python
#
# sismologia.py
#
# Scrape the sismologia.cl website list of most recent earthquakes > 3.0
# (http://www.sismologia.cl/links/ultimos_sismos.html) and localize them.
#
# Copyright (C) 2015 George C. Privon
#
# This program is free software: you can redistribute it and/or modify
@privong
privong / morning.py
Created October 26, 2014 14:05
daily website loading
#!/usr/bin/env python2
#
# Script to load a list of websites into firefox.
#
# Loads config file in: ~/.mozilla/daily_websites
# Format is:
# URL ------- (where the dashes are replaced by 1 or 0 if the page is to be
# loaded on that day of the week, [starting with Monday])
# Example, if you want to only load slashdot.org on Mon, Wed, Fri:
# http://slashdot.org 1010100
@privong
privong / usgs_daily_earthquake_check.py
Last active August 29, 2015 14:06
Earthquake checker
#!/usr/bin/env python
# Load the daily USGS atom feed and see if there are any earthquakes within
# a specified distance of a specified location
import feedparser
import argparse
import math
import sys
@privong
privong / twitter_analyze.py
Created February 21, 2013 07:05
Simple analysis of interval between tweets and tweets as a function of time of day. Uses an xml format from (the now non-functioning) twitterbackup (http://johannburkard.de/blog/programming/java/backup-twitter-tweets-with-twitterbackup.html). Fits a powerlaw to the time between tweets.
#!/usr/bin/python
#
# Usage:
# twitter_t_histogram.py file1.xml [file2.xml]
#
# first file required, second file optional (will overplot and give legends)
# Output files are file1-min.png, file1-sec.png
from xml.dom import minidom
from datetime import datetime