Skip to content

Instantly share code, notes, and snippets.

View afeld's full-sized avatar

Aidan Feldman afeld

View GitHub Profile
@afeld
afeld / civictech.md
Last active April 2, 2024 15:45
civic tech jobs in NYC (or remote)
@afeld
afeld / toggl.py
Created January 27, 2024 17:04
setting Toggl entries to billable
# didn't seem to work, but saving here in case it's useful to others
import requests
from base64 import b64encode
workspace_id = 67337
project_id = 190841872
headers = {
"content-type": "application/json",
"Authorization": "Basic %s"
@afeld
afeld / gist:5704079
Last active November 27, 2023 15:43
Using Rails+Bower on Heroku
@afeld
afeld / gist:5201086
Last active August 17, 2023 18:43
job boards
@afeld
afeld / rehearsals.rb
Last active July 3, 2023 15:51
get rehearsals from calendar
# 1. `gem install icalendar`
# 2. Get the "Secret adddress in iCal format" from Google Calendar: https://support.google.com/calendar/answer/37083#link
# 3. Open that URL in a browser to download the .ics file
# 3. Modify the constants below
# 4. Run `ruby rehearsals.rb`
require "icalendar"
require "csv"
START_FROM = DateTime.new(2023, 4, 25)
@afeld
afeld / gist:1254889
Created September 30, 2011 20:28
YouTube video ID regex
# Parses YouTube URLs directly or from iframe code. Handles:
# * Address bar on YouTube url (ex: http://www.youtube.com/watch?v=ZFqlHhCNBOI)
# * Direct http://youtu.be/ url (ex: http://youtu.be/ZFqlHhCNBOI)
# * Full iframe embed code (ex: <iframe src="http://www.youtube.com/embed/ZFqlHhCNBOI">)
# * Old <object> tag embed code (ex: <object><param name="movie" value="http://www.youtube.com/v/ZFqlHhCNBOI">...)
/(youtu\.be\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v)\/))([^\?&"'>]+)/
$5 #=> the video ID
# test it on Rubular: http://rubular.com/r/eaJeSMkJvo
@afeld
afeld / rates.csv
Last active November 21, 2022 15:06
freelance rates
Client type Hourly rate Day rate
Government/education/non-profit $200 $1,500
For-profit $250 $1,850
@afeld
afeld / domains.sh
Created March 9, 2020 21:09
get all domains (record sets) from all zones in an account in AWS Route53
#!/bin/bash
set -eo pipefail
aws route53 list-hosted-zones --query 'HostedZones[].Id' | \
jq -r '.[]' | sed 's/\/hostedzone\///' \
| \
xargs -I zone_id \
aws route53 list-resource-record-sets \
--hosted-zone-id zone_id \
@afeld
afeld / _setup.txt
Last active September 13, 2022 18:34
Seven Languages in Seven Months: Ruby presentation
git clone git://gist.github.com/3944262.git seven_langs_ruby
cd seven_langs_ruby
gem install gli -v 1.6.0
gem install showoff
showoff serve
open "http://localhost:9090"
@afeld
afeld / README.md
Last active July 27, 2022 14:24
ways to send me money