Skip to content

Instantly share code, notes, and snippets.

@i-like-robots
i-like-robots / data.js
Last active July 16, 2020 14:10
TfL API network data
exports.lines = {
"bakerloo": "Bakerloo",
"central": "Central",
"circle": "Circle",
"district": "District",
"hammersmith-city": "Hammersmith & City",
"jubilee": "Jubilee",
"metropolitan": "Metropolitan",
"northern": "Northern",
"piccadilly": "Piccadilly",
@i-like-robots
i-like-robots / SassMeister-input.scss
Last active November 27, 2017 13:31
Generated by SassMeister.com.
// ----
// libsass (v3.5.0.beta.2)
// ----
// Neutral color palette
$palette-neutral--xdark: #2C3643;
$palette-neutral--dark: #3B444F;
$palette-neutral--base: #67747C;
$palette-neutral--light: #99A9B3;
$palette-neutral--xlight: #DBE6EC;
@i-like-robots
i-like-robots / SassMeister-input.scss
Last active January 31, 2022 22:19
Managing responsive typography with Sass
// ----
// libsass (v3.5.0.beta.2)
// ----
// config/_breakpoints.scss
$breakpoints: (
small: 480px,
medium: 720px,
large: 960px,
x-large: 1280px
@i-like-robots
i-like-robots / animation_frame_queue.js
Last active August 29, 2015 14:14
Animation frame queue utility
/*
# Animation Frame Queue
A utility to ensure all queued requestAnimationFrame callbacks
are cancelled to prevent nasty surprises.
## The problem:
@i-like-robots
i-like-robots / SassMeister-input.scss
Created December 1, 2015 12:29
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
////
/// @group o-ft-icons
/// @link http://registry.origami.ft.com/components/o-ft-icons
////
@i-like-robots
i-like-robots / icons.md
Last active December 18, 2015 15:39
Comparison of SVG and font based icons

Webfont vs. SVG icons

Comparison

Font icons

Positives Negatives
Great browser support _
Easy for end users to implement _
@i-like-robots
i-like-robots / SassMeister-input.scss
Last active January 4, 2016 16:09
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
// Full range of available breakpoints
$global-breakpoints: (
'XS': 300px,
'S': 490px,
'M': 740px,
'L': 980px,
@i-like-robots
i-like-robots / webpack.config.js
Created May 9, 2016 16:25
Minimum Webpack config to output separate stylesheets with sourcemaps
'use strict'
const ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
entry: {
'./public/main.css': './src/styles.scss'
},
output: {
filename: '[name]'
@i-like-robots
i-like-robots / toggle.js
Created July 19, 2016 16:08
universal accessible toggle button
module.exports = function (buttons, target, callback) {
buttons = buttons.length === undefined ? [ buttons ] : Array.from(buttons);
const toggle = function (e) {
const state = target.classList.toggle('is-active');
buttons.forEach(button => {
button.setAttribute('aria-expanded', state);
});
@i-like-robots
i-like-robots / ads.js
Last active January 28, 2021 14:16
Minimum viable IMA implementation for desktop and mobile with support for autoplay when available and basic error handling.
'use strict'
const CLASSNAME_WAITING = 'is-waiting'
const CLASSNAME_LOADING = 'is-loading'
const CLASSNAME_PREROLL = 'is-preroll'
const CLASSNAME_PLAYING = 'is-playing'
const CLASSNAME_PROBLEM = 'is-problem'
// <https://developers.google.com/interactive-media-ads/docs/sdks/html5/sdk-player>
function ads (target) {