Skip to content

Instantly share code, notes, and snippets.

Eric Kingery ekingery

View GitHub Profile
@ekingery
ekingery / tweekly.cron
Created Jul 2, 2019
Single-User Tweekly
View tweekly.cron
# sub last.fm $USER and $KEY, uses https://github.com/twitter/twurl
38 12 * * 0 /usr/local/bin/twurl -X POST -H api.twitter.com "/1.1/statuses/update.json?status=♬ This week's top spins on $USER Last FM `curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getWeeklyTrackChart&user=$USER&api_key=$KEY&format=json" | sed s='#'==g | sed s='@'==g | jq -r '[.weeklytrackchart.track[] | .attr.rank, .artist.text, .name]' | grep -v "\]" | grep -v "\[" | paste -d" " - - - | cut -b 3- | sed s#'"'##g | sed 's#,##g' | sed s#' '#'_'#g | head -5`" | jq
View keybase.md

Keybase proof

I hereby claim:

  • I am ekingery on github.
  • I am ekingery (https://keybase.io/ekingery) on keybase.
  • I have a public key whose fingerprint is EAF4 83E6 9A02 9F9E 89AA 97CD 92CA 296D 5C8C 4CD1

To claim this, I am signing this object:

@ekingery
ekingery / parse-rcv1-topics.py
Last active Jan 5, 2017
Parse RCV1 topics into a tree structure
View parse-rcv1-topics.py
# This script parses the RCV1 topics into a tree structure
# It can then be exported to json or dotfile format
# For more info on RCV1, see
# http://jmlr.csail.mit.edu/papers/volume5/lewis04a/lewis04a.pdf
import re
from treelib import Tree
from treelib.plugins import export_to_dot
# read topics from flat file into a list of lists
@ekingery
ekingery / RCV1
Last active Dec 31, 2016 — forked from mbostock/.block
RCV1 Topics Hierarchy
View RCV1
license: gpl-3.0
@ekingery
ekingery / ek-euler-1.rb
Created Apr 1, 2016
Project Euler Problem 1
View ek-euler-1.rb
# project euler problem 1
require 'minitest/autorun'
class Problem1
def x_multiple_of_y?(x, y)
x % y == 0 ? true : false
end
def sum_multiples_below(capnum)
@ekingery
ekingery / ek-euler-26.py
Last active Aug 29, 2015
Project Euler Solution 26
View ek-euler-26.py
#!/usr/bin/env python
# solution to project euler problem #26
# https://projecteuler.net/problem=26
from decimal import *
import re
# manually crank up the significant digits until we hit the right answer
sig_dig = 10000
You can’t perform that action at this time.