Skip to content

Instantly share code, notes, and snippets.

@scascketta
scascketta / process_3ds_video.sh
Last active December 8, 2021 17:04
Demuxes 3D videos from Nintendo 3DS into two (left and right) videos and splits the videos into image frames.
#!/usr/bin/env bash
# Demuxes 3D videos from Nintendo 3DS into two (left and right) videos
# and splits the videos into image frames.
# REQUIRES FFMPEG, can be installed with Homebrew on Mac
# Install FFmpeg on ubuntu with: http://askubuntu.com/a/451158
if [ $# -ne 1 ]
then
@scascketta
scascketta / nOtTyGT6bVVlre1Bv0myt9VtCjYV4_3vOVr8c6lIs88.css
Created December 10, 2014 05:36
Hacked /r/videos CSS - the custom CSS for the /r/videos subreddit (with 6.5 million subscribers) was briefly modified to link to a Twitch channel at of 05:20 UTC December 10th, 2014
.side a[href="http://www.twitch.tv/alisha12287"] {
position:fixed;
top:0;
left:0;
height:100%;
width:100%;
z-index:999999;
background:#000;
color:#fff;
font-size:50px;
@scascketta
scascketta / README.md
Created January 16, 2015 04:34
Parsing GTFS-Realtime with Go

I installed the protocol buffers package from source.

Downloaded the gtfs-realtime protobuf definition.

Followed the instructions Go protobuf instructions and ran:

protoc --go_out=. gtfs-realtime.proto

which generated gtfs-realtime.pb.go.

@scascketta
scascketta / 11106@2015-01-20T14:57:00-06:00<---->2015-01-20T15:31:00-06:00.geojson
Last active August 29, 2015 14:13
Recorded location of three CapMetro vehicles on 01/20/15. Click on an individual marker to see the time at that position.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@scascketta
scascketta / api_diffs.txt
Created February 27, 2015 21:43
The new vehicle locations API from CapMetro is lagging behind the old API by 80 seconds on average, varies by vehicle (sometimes as much as 180 seconds)
Mean difference between current and update time (in seconds):
Old API: 129.565789474, New API: 216.00877193
Mean difference between current and update time (in seconds) by vehicle:
6026 - Old: 150.0, New: 237.0
7404 - Old: 100.0, New: 216.0
7456 - Old: 205.0, New: 272.0
8927 - Old: 95.0, New: 282.0
7451 - Old: 91.0, New: 177.0
8930 - Old: 154.0, New: 218.0
@scascketta
scascketta / backtothefuture.proto
Created March 8, 2015 23:51
Note the header's timestamp and the timestamp of the vehicle position entities.
header {
gtfs_realtime_version: "1.0"
timestamp: 1425858053 // 2015-03-08 18:40:53 CDT
}
entity {
id: "1"
vehicle {
trip {
trip_id: "1382602"
start_time: "18:39"
@scascketta
scascketta / app.yaml
Last active June 9, 2019 05:58
A Golang server to proxy XML requests, parse them to JSON, and add CORS headers.
application: scenic-cedar-88515
version: 1
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
@scascketta
scascketta / README.md
Last active September 3, 2024 03:00
How to use CapMetro's API to see where every vehicle is in real-time with Python

Parsing GTFS-Realtime with Python

Install dependencies

pip install gtfs-realtime-bindings requests

Code

@scascketta
scascketta / 1474790.csv
Created September 15, 2015 16:50
Raw vehicle position data for CapMetro vehicle 2207 from 6:41pm to 9:07pm on 2015-09-14.
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 9 columns, instead of 3 in line 9.
vehicle_id,dist_traveled,speed,lon,route_id,trip_headsign,timestamp,lat,trip_id
2207,0.00010795798364588702,0,-97.76786,1,1-Metric/South Congress-NB,2015-09-14T18:41:25-05:00,30.189432,1474790
2207,0.00010795798364588702,0,-97.76786,1,1-Metric/South Congress-NB,2015-09-14T18:43:25-05:00,30.189432,1474790
2207,0.00010795798364588702,0,-97.76786,1,1-Metric/South Congress-NB,2015-09-14T18:45:24-05:00,30.189432,1474790
2207,0.00010795798364588702,0,-97.76786,1,1-Metric/South Congress-NB,2015-09-14T18:47:24-05:00,30.189432,1474790
2207,0.00010795798364588702,0,-97.76786,1,1-Metric/South Congress-NB,2015-09-14T18:49:24-05:00,30.189432,1474790
2207,0.00010795798364588702,0,-97.76786,1,1-Metric/South Congress-NB,2015-09-14T18:51:24-05:00,30.189432,1474790
2207,0.00010795798364588702,0,-97.76786,1,1-Metric/South Congress-NB,2015-09-14T18:53:24-05:00,30.189432,1474790
2207,0.00012320448112642976,0,-97.76789,1,1-Metric/South Congress-NB,2015-09-14T18:55:24-05:00,30.189432,1474790
2207,0.0020776656795382918,0.60000002384
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.