Skip to content

Instantly share code, notes, and snippets.

Avatar

Colin Gourlay colingourlay

View GitHub Profile
View groups-descriptions.js
export default GROUPS_DESCRIPTIONS = {
abortion: `People who strongly or somewhat agree that a woman should be able to have an abortion under any circumstances.`,
age: `Responses across seven different age brackets.`,
'alcohol consumption': `People who drink at least one or more drinks per week.`,
ancestry: `People were asked the ethnic or cultural origins of their ancestors and could select multiple responses, which were coded as either ‘white’ or ‘non-white’. A person who listed a ‘non-white’ ancestry was categorised as having non-white ancestry.`,
assimilation: `People who somewhat or strongly agreed with the statement ‘Most immigrants these days don’t try hard enough to fit into Australian society’.`,
'birth country': `People were categorised based on whether they were born in Australia or elsewhere.`,
'cannabis legalisation': `People who strongly or somewhat agreed with the statement ‘Marijuana should be legalised’.`,
'cannabis use': `People who ever use cannabis.`,
'Chinese Australian'
@colingourlay
colingourlay / apple-web-dynamic-type.css
Last active Nov 30, 2020
Support Apple's dynamic text sizing in web content (iOS Safari & WebViews)
View apple-web-dynamic-type.css
/*
To support dynamic type in iOS, we need to set Apple's
system font and then define font-families and rem-based
font-sizes on descendant elements:
*/
@supports (font: -apple-system-body) {
html {
font: -apple-system-body;
}
}
View 1106432499704451072_responses_by_minute_since_publication.csv
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
@colingourlay
colingourlay / key.md
Created Feb 28, 2019 — forked from shobotch/key.md
Twitter (un)official Consumer Key
View key.md

Twitter Official Consumer Key

Twitter for Android

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

Twitter for iPhone

type:            PIN
Consumer key:    IQKbtAYlXLripLGPWd0HUA
@colingourlay
colingourlay / index.js
Created Aug 8, 2018
Playing with JSDoc-based TypeScript definitions in a preact component
View index.js
const { h } = require('preact');
const Button = require('../Button');
const styles = require('./styles.css');
/**
* CreditsNav
*
* @typedef Props
* @property {string} creditsHTML
* @property {boolean} isUnavailable
@colingourlay
colingourlay / index.css
Last active Jun 1, 2018
Mosaic with CSS grid
View index.css
body {
margin: 0;
}
.wrapper {
display: grid;
grid-template-columns: repeat(auto-fill, 50vw);
grid-template-rows: repeat(auto-fill, 50vw);
}
@colingourlay
colingourlay / user-settings.json
Last active Mar 18, 2018
My VSCode user settings
View user-settings.json
{
"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,
View kill.sh
sudo /usr/local/McAfee/AntiMalware/VSControl stopoas
sudo killall VShieldService
sudo killall VShieldScanner
@colingourlay
colingourlay / compressed.svg
Last active Aug 15, 2017
ABC lissajous spinner
View compressed.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@colingourlay
colingourlay / flat.js
Last active Jun 15, 2019
The `flat` function allows you to write then-able functions without explicitly creating your own Promises, and instead receiving the promise resolution/rejection functions as a destructure-able object as a first argument.
View flat.js
function flat(fn) {
return function (...args) {
return new Promise((resolve, reject) => {
fn.call(this, {resolve, reject}, ...args);
});
};
}