Skip to content

Instantly share code, notes, and snippets.

View wopian's full-sized avatar
🦑

James Harris wopian

🦑
View GitHub Profile
@wopian
wopian / linguist.js
Created September 8, 2020 23:31
Linguist Languages Without Colours
// node --experimental-json-modules linguist
// The JSON data is converted from the following YAML file:
// https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
import languageDump from './languages.json'
const languages = []
const languagesWithoutColour = []
const caseInsensitiveSort = (a, b) => a.language.localeCompare(b.language)
[
{
"id": "5256",
"episodeCount": 6,
"episodeLength": 34
},
{
"id": "6426",
"episodeCount": 8,
"episodeLength": 3
This file has been truncated, but you can view the full file.
{
"swagger": "2.0",
"info": {
"title": "Kitsu API Docs",
"version": "",
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).kitsuCore={})}(this,(function(t){"use strict";function e(t){var r;if("object"==typeof t&&null!==t)if(Array.isArray(t))t.map(t=>e(t));else if((null===(r=t.attributes)||void 0===r?void 0:r.constructor)===Object){for(const e of Object.keys(t.attributes))t.attributes.attributes||(t[e]=t.attributes[e]);t.attributes.attributes?t.attributes=t.attributes.attributes:delete t.attributes}return t}function r(t){if(t.response){const e=t.response.data;(null==e?void 0:e.errors)&&(t.errors=e.errors)}throw t}function n(t,{id:e,type:n}){try{if(e&&n){const r=t.filter(t=>t.id===e&&t.type===n)[0]||{id:e,type:n};return Object.assign({},r)}return{}}catch(t){r(t)}}function i({id:t,type:r,meta:i},o){const a=n(o,{id:t,type:r});return a.relationships&&l(a,o),i&&(a.meta=i),e(a)}function o(t,e,r){t[r]={},t.relationships[r].links&&(t[r].links=t.relationships[r].links),t[r].data=[];for(con
[ember-intl] "titles.media.show.units" ICU argument missing: "bn-bd": "type", "cy-gb": "type", "da-dk": "type", "en-au": "type", "en-ca": "type", "et-ee": "type", "fa-ir": "type", "fi-fi": "type", "ga-ie": "type", "he-il": "type", "hi-in": "type", "hr-hr": "type", "is-is": "type", "kk-kz": "type", "ko-kr": "type", "lv-lv": "type", "ms-my": "type", "mt-mt": "type", "nn-no": "type", "sc-it": "type", "sco-gb": "type", "sk-sk": "type", "sl-si": "type", "sr-cs": "type", "sr-sp": "type", "sv-se": "type", "th-th": "type", "ur-in": "type", "ur-pk": "type", "vi-vn": "type", "zh-tw": "type"
[ember-intl] "titles.explore.index" ICU argument missing: "bn-bd": "mediaType", "cs-cz": "mediaType", "cy-gb": "mediaType", "da-dk": "mediaType", "en-au": "mediaType", "en-ca": "mediaType", "et-ee": "mediaType", "fa-ir": "mediaType", "fi-fi": "mediaType", "ga-ie": "mediaType", "he-il": "mediaType", "hi-in": "mediaType", "hr-hr": "mediaType", "is-is": "mediaType", "kk-kz": "mediaType", "ko-kr": "mediaType", "lt-lt": "mediaType", "lv-
@wopian
wopian / 30.gml
Created November 21, 2019 14:02
South Bucks GML Snippet
<?xml version="1.0" encoding="UTF-8"?><wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:LR="www.landregistry.gov.uk" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberMatched="32251" numberReturned="32251" timeStamp="2019-10-14T11:52:40.382Z" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://192.168.4.121:8080/geoserver/schemas/wfs/2.0/wfs.xsd www.landregistry.gov.uk http://192.168.4.121:8080/geoserver/LR/wfs?service=WFS&amp;version=2.0.0&amp;request=DescribeFeatureType&amp;typeName=LR%3APREDEFINED http://www.opengis.net/gml/3.2 http://192.168.4.121:8080/geoserver/schemas/gml/3.2.1/gml.xsd"><wfs:member><LR:PREDEFINED gml:id="PREDEFINED.fid--2062c511_16dca1c9615_1bcc"><LR:GEOMETRY><gml:Polygon srsName="urn:ogc:def:crs:EPSG::27700" srsDimension="2" gml:id="PREDEFINED.fid--2062c511_16dca1c9615_1bcc.GEOMETRY"><gml:exterior><gml:LinearRing><gml:posList>505118.45 185241.15 505121.4 185254.5
@wopian
wopian / South_Bucks_30.gml
Created October 17, 2019 14:39
30 objects from Land Registry's South Bucks file (80mb/600k lines)
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:LR="www.landregistry.gov.uk" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberMatched="32251" numberReturned="32251" timeStamp="2019-10-14T11:52:40.382Z" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://192.168.4.121:8080/geoserver/schemas/wfs/2.0/wfs.xsd www.landregistry.gov.uk http://192.168.4.121:8080/geoserver/LR/wfs?service=WFS&amp;version=2.0.0&amp;request=DescribeFeatureType&amp;typeName=LR%3APREDEFINED http://www.opengis.net/gml/3.2 http://192.168.4.121:8080/geoserver/schemas/gml/3.2.1/gml.xsd">
<wfs:member>
<LR:PREDEFINED gml:id="PREDEFINED.fid--2062c511_16dca1c9615_1bcc">
<LR:GEOMETRY>
<gml:Polygon srsName="urn:ogc:def:crs:EPSG::27700" srsDimension="2" gml:id="PREDEFINED.fid--2062c511_16dca1c9615_1bcc.GEOMETRY">
<gml:exterior>
<gml:LinearRing
@wopian
wopian / South_Bucks_30.gml
Created October 17, 2019 14:39
30 objects from Land Registry's South Bucks file (80mb/600k lines)
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:LR="www.landregistry.gov.uk" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberMatched="32251" numberReturned="32251" timeStamp="2019-10-14T11:52:40.382Z" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://192.168.4.121:8080/geoserver/schemas/wfs/2.0/wfs.xsd www.landregistry.gov.uk http://192.168.4.121:8080/geoserver/LR/wfs?service=WFS&amp;version=2.0.0&amp;request=DescribeFeatureType&amp;typeName=LR%3APREDEFINED http://www.opengis.net/gml/3.2 http://192.168.4.121:8080/geoserver/schemas/gml/3.2.1/gml.xsd">
<wfs:member>
<LR:PREDEFINED gml:id="PREDEFINED.fid--2062c511_16dca1c9615_1bcc">
<LR:GEOMETRY>
<gml:Polygon srsName="urn:ogc:def:crs:EPSG::27700" srsDimension="2" gml:id="PREDEFINED.fid--2062c511_16dca1c9615_1bcc.GEOMETRY">
<gml:exterior>
<gml:LinearRing

Keybase proof

I hereby claim:

  • I am wopian on github.
  • I am wopian (https://keybase.io/wopian) on keybase.
  • I have a public key ASCBZgcFPWbLyvrJ4fiR2tJTkf5wIsy2uXQfzoYtenhYCwo

To claim this, I am signing this object:

@wopian
wopian / range.mjs
Created September 1, 2018 20:49
Expand '1-2,4-5' to '1,2,4,5' and print numbers missing in sequence
const { assert, log } = console
const input = '1-2,4-6'
const output = '1,2,4,5,6'
const outputMissing = '3'
const numericSort = (a, b) => a - b
function expandRange (string) {
return String(string.split(',').reduce(function (r, a) {
var b = a.split('-').map(Number)
do {