Skip to content

Instantly share code, notes, and snippets.

View MikeRalphson's full-sized avatar
💭
I may be slow to respond.

Mike Ralphson MikeRalphson

💭
I may be slow to respond.
View GitHub Profile
@hubgit
hubgit / From an iPlayer PID to the subtitles XML
Created December 20, 2012 11:20
Subtitles for an iPlayer programme
http://www.bbc.co.uk/iplayer/episode/b01pdt0s/Rome_A_History_of_the_Eternal_City_The_Rebirth_of_Gods_City/
=> b01pdt0s
http://www.bbc.co.uk/iplayer/playlist/b01pdt0s
=> b01pdt0g
http://www.bbc.co.uk/mediaselector/4/mtis/stream/b01pdt0g
=> http://www.bbc.co.uk/iplayer/subtitles/ng/0/g/b01pdt0g_1355502767.xml
http://www.bbc.co.uk/iplayer/playlist/bbc_one
=> http://www.bbc.co.uk/mediaselector/4/mtis/stream/bbc_one_london
=> ?
@earth2marsh
earth2marsh / uber.yaml
Last active April 5, 2021 13:39
A Swagger YAML specification for Uber's new API
swagger: 2
info:
title: The new Uber API
description: Move your app forward with the Uber API
version: "1.0.0"
host: api.uber.com
schemes:
- https
basePath: /v1
produces:
@hskrasek
hskrasek / gist:7469f2c5d0650fc58bd1
Created December 10, 2014 20:31
IODocsConverter
import json
from pprint import pprint
from os.path import expanduser
import os
home = expanduser("~")
baseDir = home + '/Documents/Projects/iodocs/public/data'
for subdir, dirs, files in os.walk(baseDir):
for file in files:
# if file == 'apiconfig.json' or file.startswith('.'):
@carols10cents
carols10cents / javascript-to-rust-cheat-sheet.md
Last active October 28, 2023 07:57
JavaScript to Rust Cheat Sheet

JavaScript to Rust Cheat Sheet

The goal of this is to have an easily-scannable reference for the most common syntax idioms in JavaScript and Rust so that programmers most comfortable with JavaScript can quickly get through the syntax differences and feel like they could read and write basic Rust programs.

What do you think? Does this meet its goal? If not, why not?

Variables

JavaScript:

@jareware
jareware / s3-curl-backups.md
Last active May 11, 2024 23:39
Simple, semi-anonymous backups with S3 and curl

⇐ back to the gist-blog at jrw.fi

Simple, semi-anonymous backups with S3 and curl

Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl. Hold onto your hats, there's some Bucket Policy acrobatics ahead.

There's also a tl;dr at the very end if you just want the delicious copy-pasta.

Bucket setup

@kaizhu256
kaizhu256 / processExecSync.js
Last active October 19, 2016 09:37
synchronously run system command in nodejs <= 0.10.x
/*jslint
maxerr: 8,
maxlen: 96,
node: true,
stupid: true
*/
(function () {
'use strict';
function processExecSync(command, options) {
Copy of http://pastebin.com/5HUwk2jA
ABC Radio appears to be using a service from http://newrelic.com. You can get the ten most recently played tracks across their enabled stations here:
http://music.abcradio.net.au/api/v1/plays/search.json
Or you can add these parameters (as their web apps do to generate playlists):
from=yyyy-mm-ddThh:mm:ss.000Z // Date range start in UTC e.g. 2014-04-30T00:00:00.000Z
to=yyyy-mm-ddThh:mm:ss.000Z // Date range end in UTC e.g. 2014-04-30T00:00:00.000Z
@Moussa
Moussa / zrmc.js
Created February 9, 2016 19:16
Zombies, Run! Mission counts
(function () {
'use strict';
var base_url = 'https://api.zombiesrungame.com/runs/summaries/?page=';
var page = 1;
var results = [];
var alphanumericalSort = function (a, b) {
// Taken from https://gist.github.com/devinus/453520#file-gistfile1-js
var NUMBER_GROUPS = /(-?\d*\.?\d+)/g;
{
"_embedded": {
"promotions": [{
"type": "url",
"contentfulName": "15 minute container",
"position": "primary",
"title": "Mark's First URL Promo",
"subtitle": "It's the first one I tell ya",
"_links": {