Skip to content

Instantly share code, notes, and snippets.

View rjc123's full-sized avatar

Robin Carswell rjc123

View GitHub Profile
@rjc123
rjc123 / gist:78dbb3f6a5979cef680ddd1f0b28f7a8
Last active November 20, 2024 14:57
Shell script for converting downloaded x-twitter archive posts into useable markdown for hugo static site.
#!/bin/zsh
#assumes twitter archive in "data" directory and hugo-parser script has been run
cd data/parser-output
mkdir ../hugo_md_output
ls tweets-md | grep 2 > inputyear &&
while read year
do
echo "---" > ../hugo_md_output/twitter_$year.md
echo "title: \"Twitter archive, $year\"" >> ../hugo_md_output/twitter_$year.md
@rjc123
rjc123 / Bullseye.bookmarklet
Created June 28, 2021 10:55 — forked from ttscoff/Bullseye.bookmarklet
A bookmarklet for grabbing just a piece of a web page and converting it to Markdown using heckyesmarkdown.com.
javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading&hellip;</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://cdn.rawgit.com/ttscoff/6109434/raw/Bullseye.js?x="+(Math.random());})();
@rjc123
rjc123 / gist:dffa53bd6145198e683c89f32a6e27a7
Created December 2, 2020 16:23 — forked from mhawksey/gist:1442370
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@rjc123
rjc123 / marky.rb
Created February 6, 2018 18:01 — forked from ttscoff/marky.rb
Ruby script for interfacing with Marky the Markdonwifier
#!/usr/bin/env ruby
require 'open-uri'
require 'net/http'
require 'iconv'
require 'optparse'
require 'fileutils'
require 'cgi'
$options = {}
@rjc123
rjc123 / gist:dc1d62d708e5aa42f465
Created December 11, 2014 11:34
DMO reports to be reinstated
https://www.gov.uk/government/publications/united-kingdom-debt-management-office-annual-report-and-accounts-2012-to-2013
https://www.gov.uk/government/publications/united-kingdom-debt-management-office-annual-report-and-accounts-2011-to-2012
https://www.gov.uk/government/publications/national-insurance-fund-investment-account-accounts-for-the-year-ended-31-march-2011
https://www.gov.uk/government/publications/united-kingdom-debt-management-office-annual-report-and-accounts-2010-to-2011
https://www.gov.uk/government/publications/united-kingdom-debt-management-office-annual-report-and-accounts-2009-to-2010
https://www.gov.uk/government/publications/united-kingdom-debt-management-office-report-and-accounts-2008-to-2009
https://www.gov.uk/government/publications/united-kingdom-debt-management-office-report-and-accounts-2007-to-2008
https://www.gov.uk/government/publications/united-kingdom-debt-management-office-report-2006-to-2007
https://www.gov.uk/government/publications/insolvency-act-1986-accounts-2005-to-200
@rjc123
rjc123 / gist:f41118203b23621fbb6a
Created December 2, 2014 16:08
The first page of data from EduBase
Establishment Name,Local Authority,Town,Establishment Status,Sixth Form Centres,URN,GSS LA Code,General Subcategory,General Subcategory data,Summary Data Header,Summary Data,Status and Date,Establishment No,Address,Link URN,Link Name,Link Type,Link Date
16-19 Abingdon,Oxfordshire,,Open,Sixth Form Centres,133226,GSS LA Code: E10000025,,,Phase of Education,Not applicable,Status: Open 01/09/2000,4901,16-19 Abingdon,,,,
16-19 Abingdon,Oxfordshire,,Open,Sixth Form Centres,133226,GSS LA Code: E10000025,,,Type of Establishment,Sixth Form Centres,Status: Open 01/09/2000,4901,16-19 Abingdon,,,,
16-19 Abingdon,Oxfordshire,,Open,Sixth Form Centres,133226,GSS LA Code: E10000025,,,Age Range,16 - 19,Status: Open 01/09/2000,4901,16-19 Abingdon,,,,
16-19 Abingdon,Oxfordshire,,Open,Sixth Form Centres,133226,GSS LA Code: E10000025,,,Gender,Mixed,Status: Open 01/09/2000,4901,16-19 Abingdon,,,,
16-19 Abingdon,Oxfordshire,,Open,Sixth Form Centres,133226,GSS LA Code: E10000025,,,"Religious Character
This field shows any religious
@rjc123
rjc123 / gist:3171f14ac9b8b5b4d971
Last active August 29, 2015 14:10
MAIB accident flyers
[1](http://www.maib.gov.uk/publications/accident_flyers/fishing_vessel_flyer_2005/chelaris_j.cfm)
[2](http://www.maib.gov.uk/publications/accident_flyers/fishing_vessel_flyer_2005/engine_room_fire_in_wooden_creel_boat.cfm)
[3](http://www.maib.gov.uk/publications/accident_flyers/fishing_vessel_flyer_2005/loss_of_beam_trawler_flamingo.cfm)
[4](http://www.maib.gov.uk/publications/accident_flyers/fishing_vessel_flyer_2005/crew_fall_into_fish_hold.cfm)
[5](http://www.maib.gov.uk/publications/accident_flyers/fishing_vessel_flyer_2005/family_tragedy_averted.cfm)
[6](http://www.maib.gov.uk/publications/accident_flyers/fishing_vessel_flyer_2005/collision_and_sinking_while_pair_trawling.cfm)
[7](http://www.maib.gov.uk/publications/accident_flyers/merchant_vessel_flyers_2006/grounding_of_cargo_ship.cfm)
[8](http://www.maib.gov.uk/publications/accident_flyers/merchant_vessel_flyers_2006/spruce.cfm)
[9](http://www.maib.gov.uk/publications/accident_flyers/merchant_vessel_flyers_2006/kathrin.cfm)
[10](http://www.maib.gov.uk
@rjc123
rjc123 / gist:a69ddcf71c284ec64716
Created July 7, 2014 14:16
BIS Legacy Domains
abcalculator.bis.gov.uk
BEGIN EVALUATING abcalculator.bis.gov.uk
1. Checking DNS
abcalculator.bis.gov.uk. 299 IN A 83.137.210.86
2. Checking homepage
HTTP/1.1 301 Moved Permanently
Location: https://www.gov.uk/government/organisations/department-for-business-innovation-skills
HTTP/1.1 200 OK