Skip to content

Instantly share code, notes, and snippets.

View johanbrook's full-sized avatar
🌴

Johan Brook johanbrook

🌴
View GitHub Profile
// Run with:
// $ TZ="Europe/London" deno run --unstable-temporal
const DATE_FORMAT: Intl.DateTimeFormatOptions = {
month: 'long',
year: 'numeric',
day: 'numeric',
hour: '2-digit',
hour12: false,
minute: '2-digit',
@johanbrook
johanbrook / _test-helper.ts
Last active March 16, 2022 19:31
Run with `./run-tests.ts`.
// test/_test-helper.ts
type Test = () => void | Promise<void>;
export interface TestCase {
name: string;
test: Test;
path?: string;
}
@johanbrook
johanbrook / github.css
Created May 12, 2015 17:40
HighlightJS GitHub style
/*
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #333;
background: #f8f8f8;
@johanbrook
johanbrook / recept.md
Last active October 18, 2018 20:18
Johans Risotto

Johans Risotto

Ingredienser

  • Svamp att steka (kantareller eller skogschampinjoner, mer än vad man tror)
  • Smör
  • Olivolja
  • Vitlök
  • Risottoris (arborio eller carnaroli)
  • Chalottenlök
@johanbrook
johanbrook / gist:761909
Created January 1, 2011 18:36
Convert an ICNS file to PNG with alpha transparency
sips -s format png /Applications/Safari.app/Contents/Resources/compass.icns --out /Users/Johan/Desktop/safari.png
@johanbrook
johanbrook / jquery.scroll-stroke.js
Created November 25, 2014 23:09
jQuery plugin for drawing an SVG line while scrolling.
/*
jQuery plugin for drawing a svg line as you scroll.
@author Johan Brook, for Lookback (2014).
Options:
startAt: The reference point to start calculating from. Expects a selector.
speed: at which speed the line should draw.
offset: the offset of which the reference point should be.
@johanbrook
johanbrook / disable-hcr.js
Created October 6, 2015 07:58
Disable Hot Code Reload in Meteor with a settings variable (`DISABLE_AUTO_RELOAD`).
Meteor.startup(function() {
if (Meteor.settings && Meteor.settings.public && Meteor.settings.public.DISABLE_AUTO_RELOAD) {
Meteor._reload.onMigrate(function(reloadFunction) {
return [false];
});
}
});
@johanbrook
johanbrook / johansfilmer.md
Last active March 26, 2017 19:05
Garanterat bra filmer.
  • Tulip Fever
  • Sleeping Beauty
  • Incendies
  • Rust And Bone (4/5)
  • The Big Short (3/5)
  • Joy (4/5)
  • Wild Tales (5/5)
  • Hail Caesar (3/5)
  • My Blueberry Nights (didn’t finish)
  • Mulholland Drive (5/5)
@johanbrook
johanbrook / nyc.md
Created March 24, 2017 18:43
NYC-tips för Hanna

Saker jag gjorde i New York som var nice

Jag gjorde inte alltför många turistiga grejer, jag traskade mest bara omkring och upptäckte saker. Det är så mycket cool energi i de olika stadsdelarna, så det liksom räckte för mig (tom. tunnelbanan är cool!). Googla upp om det finns spännande restauranger ni vill dra på, utifall ni behöver bokningar eller så. NYC har sååå mycket sånt coolt. Allmänt så är maten nice och inte jättesvindyr.

  1. Dumbo i Brooklyn var coolt! Bra vy över södra Manhattan. Bara ta vagnen över Manhattan bridge (tror jag) och hoppa av på första stationen väl i Brooklyn.
  2. De har bra pizza på Julia's (tror jag namnet var) i Dumbo.
@johanbrook
johanbrook / index.html
Created October 20, 2016 03:26
Put a screen1.m4v file in the same folder and serve.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>MediaSource</title>
</head>
<body>
<video id="video"></video>
<script type="text/javascript">