Skip to content

Instantly share code, notes, and snippets.

View ashtom's full-sized avatar
:octocat:
the job is not to know; it's to become

Thomas Dohmke ashtom

:octocat:
the job is not to know; it's to become
View GitHub Profile
@ashtom
ashtom / hadge.rb
Created November 6, 2021 22:59
Update a pinned gist to show your currently workout stats
require 'csv'
require 'octokit'
require 'optparse'
class DirectImporter
DISPLAYED_ACTIVITIES = {
Running: '‍🏃‍♂️',
Walking: '🚶‍♂️',
Hiking: '🥾',
Cycling: '🚴‍♂️',
@ashtom
ashtom / gist:486d1e3aaca45df63dc70984dfe98514
Created October 3, 2021 18:53
this space is intentionally left blank
@ashtom
ashtom / latest reads
Last active October 10, 2024 19:02
Currently reading:
All Systems Red by Martha Wells
Recently read:
Storyworthy by Matthew Dicks
🚶‍♂️ 235km ██████▌░░░░░░░░░░░░░
🏂 191km █████▍░░░░░░░░░░░░░░
‍🏃‍♂️ 187km █████▏░░░░░░░░░░░░░░
🚴‍♂️ 62km █▌░░░░░░░░░░░░░░░░░░
🥾 19km ▍░░░░░░░░░░░░░░░░░░░
692km total
🏃‍♂️ 297.85 km ███████████████████
🏊‍♂️ 0.00 km ░░░░░░░░░░░░░░░░░░░
🚴‍♂️ 0.00 km ░░░░░░░░░░░░░░░░░░░
🗓 0.00 km
👩🏻‍🔧 Kaylee: So, um, how come you
don’t care where you’re going?
👩🏾‍🌾 Book: ‘Cause how you get there
is the worthier part.
### Keybase proof
I hereby claim:
* I am ashtom on github.
* I am ashtom (https://keybase.io/ashtom) on keybase.
* I have a public key whose fingerprint is E34B 112A 5FA7 D46A 7455 9E11 6E71 8750 737E 08F6
To claim this, I am signing this object:
@ashtom
ashtom / log_reqresp.rb
Created May 12, 2012 13:46
Log ActiveResource request / response
class ActiveResource::Connection
def http
# Setup http object
http = Net::HTTP.new(@site.host, @site.port)
http.use_ssl = @site.is_a?(URI::HTTPS)
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl
http.read_timeout = @timeout if @timeout
# Log to stderr
http.set_debug_output $stderr
@ashtom
ashtom / download_stats.rb
Created April 13, 2012 14:51
Download App Stats from HockeyApp
require "json"
require "rest-client"
# Replace with your values
APP_ID = "APP_ID"
API_TOKEN = "API_TOKEN" # Needs rw rights
BASE_URL = "https://rink.hockeyapp.net/api/2/apps/"
response = RestClient.get "#{BASE_URL}#{APP_ID}/app_versions", {"X-HockeyAppToken" => API_TOKEN}
app_versions = JSON.parse(response)