Skip to content

Instantly share code, notes, and snippets.

View colingourlay's full-sized avatar

Colin Gourlay colingourlay

View GitHub Profile
@syntagmatic
syntagmatic / README.md
Last active August 30, 2017 03:43 — forked from syntagmatic/README.md
Average Price Histories II
@mbostock
mbostock / .block
Last active January 28, 2025 18:06 — forked from mbostock/.block
Choropleth
license: gpl-3.0
height: 600
border: no
redirect: https://beta.observablehq.com/@mbostock/d3-choropleth
@mbostock
mbostock / .block
Last active November 12, 2024 15:43
World Map
license: gpl-3.0
redirect: https://observablehq.com/@mbostock/map-coloring
@mbostock
mbostock / .block
Last active January 9, 2020 22:27
Three-Axis Rotation
license: gpl-3.0
redirect: https://observablehq.com/@d3/three-axis-rotation
@anantn
anantn / firebase_player_assignment.js
Last active January 14, 2023 01:51
Firebase: Assigning players in a multiplayer game. This snippet assigns you a spot in a game if the game isn't full yet.
function go() {
var userId = prompt('Username?', 'Guest');
// Consider adding '/<unique id>' if you have multiple games.
var gameRef = new Firebase(GAME_LOCATION);
assignPlayerNumberAndPlayGame(userId, gameRef);
};
// The maximum number of players. If there are already
// NUM_PLAYERS assigned, users won't be able to join the game.
var NUM_PLAYERS = 4;
@drublic
drublic / rem-fallback.less
Last active March 28, 2020 23:57
Fallback rem-mixin in Sass and LESS
@main-font-size: 16px;
.x-rem (@property, @value) {
// This is a workaround, inspired by https://github.com/borodean/less-properties
@px-fallback: @value * @main-font-size;
-: ~`(function () { return ';@{property}: @{px-fallback}'; }())`;
-: ~`(function () { return ';@{property}: @{value}rem'; }())`;
}
@cassiano-gists
cassiano-gists / gist:4706235
Created February 4, 2013 11:31
CSS: SASS: @media for responsive design using REM units
/* http://techtime.getharvest.com/blog/in-defense-of-rem-units */
html
font-size: 16px
@media screen and (min-width: 1600px) // Large Monitors
font-size: 18px
@media screen and (min-width: 1400px) // Small Laptops
font-size: 14px
@media screen and (min-width: 1100px) // Tablet Landscape
@rvagg
rvagg / README.md
Last active July 27, 2025 23:25
Kindleberry "Paperwhite" Pi

Work in progress, I'll write this up properly when I'm done.

Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.

Prerequisites:

  • Raspberry Pi
  • Kindle Paperwhite freed from its locked down state (jailbroken) http://www.mobileread.com/forums/showthread.php?t=198446
    • You have to downgrade your Kindle to 5.3.1 to install the current jailbreak; that's just a matter of getting the old version image, putting it on your Kindle via USB and telling it to install "upgrade". Then you put in the Jailbreak files, load the ebook and break.
  • Your kindle will be quick to detect an upgrade is available so it'll want to upgrade soon afterwards but the jailbreak will last but you have to reinstall the developer certificates so it's a bit of a pain but doable. Find all the instructions on the mobileread.com forums and wiki.
@dfkaye
dfkaye / import-scripts-proposal.md
Last active April 9, 2017 14:46
importScripts boilerplate pattern proposal alternatives for javascript

"JavaScript doesn't need more features; it just needs a couple of small things fixed" - Ryan Dahl

The CommonJS and AMD module syntaxes are unfriendly to each other, requiring boilerplate everywhere, which UMD tries to solve with more boilerplate.

The ES6 module syntax adds new keywords in strict mode, that then depend on a sharply modified cross-origin requests shims, and internal module management. An ES6 Module Transpiler aims to solve the not-yet-supporting environments problem with a source transformation step.

We don't need more syntax like imports x from 'x.js'. We don't need a module keyword that will break QUnit module() or Node.js modules.

@bjeanes
bjeanes / t9.rb
Last active December 16, 2015 03:49
T9 Kata
##################################################################
# Given a list of words, model a T9[1] predictive text engine. #
# #
# Input to the function will be a series of pressed digits. The #
# output should be a set of all possible words that can be built #
# using those keys as the prefix. #
# #
# [1] http://en.wikipedia.org/wiki/T9_(predictive_text) #
##################################################################