Skip to content

Instantly share code, notes, and snippets.


Jarno Rantanen jareware

View GitHub Profile
jareware / full-screen.html
Created Oct 6, 2017
Grafana full screen "plugin"
View full-screen.html
<button id="enter-full-screen">Enter full screen</button>
#enter-full-screen {
display: block;
margin: 60px auto;
padding: 30px 70px;
background: #464545;
border: 1px solid #636363;
jareware /
Last active Aug 10, 2018
Raspberry Pi -based sensor station

Raspberry Pi -based sensor station

This is mostly documentation for myself. Feel free to use any of it if it helps, though.


jareware /
Last active Oct 30, 2020
Enforcing the engines property of package.json

Document your target environment with:

"engines": {
  "npm": ">=3.3.12 <4",
  "node": ">=5.5.0 <6"

Then install this:

"devDependencies": {


Important: At the time of writing (2019-11-11) Immutable.js is effectively abandonware, so I can no longer recommend anyone to follow the advice given here. I'll leave the article here for posterity, since it's still getting some traffic.

Understanding Immutable.Record

Functional programming principles and with it immutable data are changing the way we write frontend applications. If the recent de-facto frontend stack of React and Redux feels like it goes perfectly together with immutable data, that's because it's specifically designed for that.

There's several interesting implementations of immutable data for JavaScript, but here I'll be focusing on Facebook's own Immutable.js, and specifically on one of i

View Component.js
export default renderFromStores(
[ 'fooStore', 'barStore' ],
({ fooStore, barStore, bazActions }) => (
Hola {fooStore.getName()}!
<button onClick={bazActions.doStuff}>Cheap</button>
<button onClick={() => bazActions.doStuffWith(fooStore.getName())}>Expensive</button>
jareware /
Last active Jun 7, 2018
Quick PSA on icon fonts and ligatures

Long Live Icon Fonts!

or, a Quick PSA on icon fonts and ligatures.

tl;dr: keep using icon fonts, they are nice, just enable ligatures

These are my talking notes at the on 2015-12-04:

View eslint-instanceof-hazard.js
module.exports = function(context) {
'use strict';
return {
BinaryExpression: function(node) {
if (node.operator === 'instanceof' && node.left.type === 'UnaryExpression' && node.left.operator === '!') {, "Check dangerous instanceof use (! has higher precedence than instanceof)");

Freaklies goes ES6


Classes are purely syntactic sugar:

class Animal {
  constructor(name) { = name;
jareware /
Last active Nov 8, 2019
Transparent boot2docker on OS X for a native-Linux-like Docker experience

Transparent boot2docker on OS X

This is how you can autorun boot2docker on boot, so that you can use docker as you would on Linux, without ever* knowing that the daemon's not running locally.

  1. Install VirtualBox & boot2docker (obviously)
  2. Create a startup script with Automator
  3. Put in /usr/local/bin/boot2docker up && /usr/local/bin/boot2docker shellinit > ~/
  4. Add echo "export DOCKER_IP=$(boot2docker ip 2>/dev/null)" >> ~/ if you want the non-standard but very-convenient DOCKER_IP env-var as well (thanks for the suggestion @city41!)
  5. Update your .profile or equivalent file with source ~/
  6. Reboot your machine
jareware /
Last active Aug 29, 2021
Simple, semi-anonymous backups with S3 and curl

⇐ back to the gist-blog at

Simple, semi-anonymous backups with S3 and curl

Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl. Hold onto your hats, there's some Bucket Policy acrobatics ahead.

There's also a tl;dr at the very end if you just want the delicious copy-pasta.

Bucket setup