This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I was struggling to get an export of my Disqus comments because their export feature never provided any results. | |
# I discovered https://blog.jasonantman.com/2014/03/python-script-to-backup-disqus-comments/ (https://github.com/jantman/misc-scripts/blob/master/disqus_backup.py) | |
# which is a Python script to download your Disqus comments. | |
# This script didn't work for me on python3 but I installed python2 and it worked fine. | |
# | |
# Afterwards I had a JSON dump of my comments. I wrote the below script to parse these JSON comments into a CSV | |
# with a thread_link and comment column. | |
# It's not a perfect export format (that's what the JSON is for) but it's good enough for me to read the comments. | |
# | |
# Run with: `ruby parse_disqus_json.rb dump.json export.csv` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
ALBUMS_PATH = "[enter path here]/albums.json" # The path of the `albums.json` file | |
PHOTO_FOLDER_PATH = "[enter path here]" # The path where all the photo JSON files are | |
EXPORT_PATH = "[enter path here]/metadata_summary.csv" # The path to save the CSV export | |
FlickrAlbum = Struct.new(:id, :title, :description, :photos) | |
FlickrData = Struct.new(:id, :name, :description, :date_taken, :date_imported, :geo, :comments, :album) | |
# Parse photos data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/helpers/s3_presigned_url_issue_time_helper.rb | |
# | |
# S3 presigned URLs include the time they're issued. | |
# This means if we generate a presigned URL as part of a request it'll be a different | |
# URL each time, making it impossible for the browser to cache. | |
# | |
# By default Rails mitigates this issue with the rails_representation_url - a permanent path | |
# for the file which redirects to the presigned URL (and can be cached just like the S3 resource) | |
# | |
# However, this approach results in an additional web request for each file shown on the page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I use this as my most recent solution to the problems described in: | |
# https://jordancrawford.kiwi/home-server-without-portforward | |
# This is an excerpt. | |
# To access LetsEncrypt Manager commands, use docker-compose run --rm letsencrypt <command>. | |
# To setup DHParams, use: https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html openssl dhparam -out dhparam.pem 4096 | |
version: '2' | |
services: | |
nginx: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# != 1 ] | |
then | |
echo "drive_power_status [name of device to watch]" | |
exit | |
fi | |
device=$1 | |
echo "Started watching $device state" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OLD_REPO_NAME=[fill this in] | |
NEW_REPO_NAME=[fill this in] | |
USERNAME=[fill this in] | |
# Create the new repo in GitHub first. | |
# For all repos. This does a mirror clone so all references, tags, etc are migrated. | |
git clone --mirror git@bitbucket.org:$USERNAME/$OLD_REPO_NAME.git | |
cd $OLD_REPO_NAME.git | |
git push --mirror git@github.com:$USERNAME/$NEW_REPO_NAME.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name = cloud | |
AddressFamily = ipv4 | |
Interface = tun0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: The player uses their turn to claim a route and the route appears as claimed. | |
Given a game with 5 players is setup | |
And the player has 5 train pieces | |
And the player has 5 "Hopper" train cars | |
And the player navigates to the game page | |
When the player clicks the claim route button on a route between "Vancouver" and "Calgary" | |
And the player selects 3 "Hopper" train cars | |
And the player clicks the "Claim Route" button | |
Then the player is on the game page | |
And the player sees the route from "Vancouver" to "Calgary" claimed with their name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context "on ClaimRoute failure" do | |
let(:service_double) { instance_double(ClaimRoute, call: service_result, errors: service_expected_errors) } | |
let(:service_result) { false } | |
let(:service_expected_errors) { [ClaimRoute::REQUIRED_PARAMETERS_NOT_PROVIDED] } | |
before do | |
post_claim_route | |
end | |
it "redirects to the game page" do |