Skip to content

Instantly share code, notes, and snippets.

View ekingery's full-sized avatar

Eric Kingery ekingery

View GitHub Profile
@ekingery
ekingery / ek-euler-26.py
Last active August 29, 2015 14:18
Project Euler Solution 26
#!/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
@ekingery
ekingery / ek-euler-1.rb
Created April 1, 2016 00:15
Project Euler Problem 1
# 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 / RCV1
Last active December 31, 2016 04:33 — forked from mbostock/.block
RCV1 Topics Hierarchy
license: gpl-3.0
@ekingery
ekingery / parse-rcv1-topics.py
Last active January 5, 2017 17:07
Parse RCV1 topics into a tree structure
# 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

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 / tweekly.cron
Created July 2, 2019 15:54
Single-User Tweekly
# 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
@ekingery
ekingery / configlet-analysis.md
Last active February 5, 2021 14:07
High level analysis of the features, functionality, and challenges in modifying configlet to support V3

Configlet Analysis for Exercism V3

A language track's config.json file provides a way to pass data between the track's git repo and the V3 website's ActiveRecord data model. configlet is a tool for validation and sanitization of the shared config data as it is transferred between the decentralized track repos and the centralized data models.

configlet is integrated (to varying degrees) into the CI / build process of the language track repos. It is also downloaded and used locally by track maintainers to assist in understanding, validating, and formatting the track config.json files. As part of exercism V3, we will be evolving the specifications (of config.json). This provides a good opportunity to analyze the open issues with configlet and evaluate the best path forward.

Based on the analysis below, I would like to consider replacing configlet with an API (either built into the v3-website or as a standalone service used by the v3-website). As-neede