Skip to content

Instantly share code, notes, and snippets.

View colingourlay's full-sized avatar

Colin Gourlay colingourlay

View GitHub Profile
@colingourlay
colingourlay / key.md
Created February 28, 2019 02:54
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

minutesSincePublication quotes replies retweets quotesCumulative repliesCumulative retweetsCumulative
1 0 0 0 0 0 0
2 0 1 0 0 1 0
3 0 2 1 0 3 1
4 0 3 0 0 6 1
5 0 3 1 0 9 2
6 0 4 0 0 13 2
7 0 1 2 0 14 4
8 0 2 1 0 16 5
9 0 3 0 0 19 5
(function (w) {
// Define two queues for handlers
w.readyQ = [];
w.bindReadyQ = [];
// Define the fake jQuery function to capture handlers
w.$ = w.jQuery = function (handler) {
// Push a handler into the correct queue
@colingourlay
colingourlay / index.js
Created August 8, 2018 04:36
Playing with JSDoc-based TypeScript definitions in a preact component
const { h } = require('preact');
const Button = require('../Button');
const styles = require('./styles.css');
/**
* CreditsNav
*
* @typedef Props
* @property {string} creditsHTML
* @property {boolean} isUnavailable
@colingourlay
colingourlay / Array.apply
Last active May 28, 2018 09:35
Function.prototype.apply 's handling of an object instead of an array. It forces the object through Array.prototype.slice function as 'this' to create an array, pretty much what we do to turn an arguments object into a real array.
Array.apply(null, [1, 2, 3])
> [1, 2, 3]
Array.apply(null, [1, 2, 3]).length
> 3
Array.apply(null, {length:3})
> [undefined, undefined, undefined]
Array.apply(null, {length:3}).length
@colingourlay
colingourlay / user-settings.json
Last active March 18, 2018 05:49
My VSCode user settings
{
"editor.fontFamily": "Monofur, Menlo, Monaco, Consolas, 'Courier New', monospace",
"editor.fontSize": 15,
"editor.formatOnSave": true,
"editor.tabSize": 2,
"explorer.openEditors.visible": 0,
"files.insertFinalNewline": true,
"git.enableSmartCommit": true,
"git.confirmSync": false,
"prettier.jsxBracketSameLine": true,
@colingourlay
colingourlay / compressed.svg
Last active August 15, 2017 03:10
ABC lissajous spinner
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@colingourlay
colingourlay / index.css
Last active August 1, 2017 00:40
Use the fully qualified path of stylesheets you control to discover relative asset paths, no matter where your assets are deployed.
[xyz] { content: url(../); }
@colingourlay
colingourlay / index.js
Last active October 26, 2016 06:00
Using the Y combinator to immutably apply a series of operations to a value, using outputs as inputs. A "Function Centipede", if you will.
const Y = f => (x => x(x))(x => f(y => x(x)(y)));
const manufacture = Y(f => x => x.length > 1 ? f([x[1](x[0])].concat(x.slice(2))) : x[0]);
const stage = x => y => manufacture([y].concat(x));
const operations = [
x => x + 1,
x => x * 3,
x => x - 2
];
const transform = stage(operations);
@colingourlay
colingourlay / index.js
Created October 25, 2016 23:57
requirebin sketch
require('pointer-css-variables')(true);
var height;
var nextHeight = window.innerHeight;
window.requestAnimationFrame(function updateHeight () {
if (nextHeight !== height) {
height = nextHeight;
document.documentElement.style.setProperty('--window-inner-height', height);
}