Skip to content

Instantly share code, notes, and snippets.

Avatar
🚄
Making treo.sh

Aleksey Kulikov alekseykulikov

🚄
Making treo.sh
View GitHub Profile
@bluesmoon
bluesmoon / loader.html
Last active Apr 17, 2020
A CSP compliant non-blocking script loader
View loader.html
<script id="nb-loader-script">
(function(url) {
// document.currentScript works on most browsers, but not all
var where = document.currentScript || document.getElementById("nb-loader-script"),
promoted = false,
LOADER_TIMEOUT = 3000,
IDPREFIX = "__nb-script";
// function to promote a preload link node to an async script node
@johngrimes
johngrimes / macos-10133-fail.md
Last active Feb 5, 2021
macOS 10.13.3 Update FAIL
View macos-10133-fail.md

I had some massive problems when installing the 10.13.3 update on macOS. The update installed, my computer successfully restarted - but on a subsequent restart the boot failed and displayed the following installation log:

Apr  4 04:07:04 MacBook-Pro opendirectoryd[186]: [session] Processing a network change notification
Apr  4 04:07:06 MacBook-Pro Unknown[526]: Launching the Language Chooser for an OS Install
Apr  4 04:07:06 MacBook-Pro bspowerassertiontool[521]: Tool exited successfully (0).
Apr  4 04:07:06 MacBook-Pro launchprogresswindow[524]: ISAP: Show progress UI called
Apr  4 04:07:07 MacBook-Pro Installer Progress[180]: Progress UI App Starting
Apr  4 04:07:32 MacBook-Pro opendirectoryd[186]: [session] Received a network change notification
Apr  4 04:07:32 MacBook-Pro opendirectoryd[186]: [session] Received a network change notification
@paulirish
paulirish / eqt.js
Last active Apr 26, 2020
Expected Queueing Time metric
View eqt.js
// Expected Queueing Time
// https://docs.google.com/document/d/1Vgu7-R84Ym3lbfTRi98vpdspRr1UwORB4UV-p9K1FF0/edit
// Initial impl by Nicolás Peña (npm), Tim Dresser (tdresser)
// Usage:
// var eqt = EQT.begin();
// // ...
// const {expectedQueueingTime} = EQT.end();
class EQT {
constructor() {
@ebidel
ebidel / coverage.js
Last active Jan 12, 2022
CSS/JS code coverage during lifecycle of page load
View coverage.js
Moved to https://github.com/ebidel/puppeteer-examples
@mafintosh
mafintosh / bitcoin-for-laypeople.md
Last active Apr 1, 2020
Blog post about how Bitcoin works in a way non computer people can understand it
View bitcoin-for-laypeople.md

Bitcoin for laypeople

(Chinese version available here, courtesy of @jiangplus

(This is an English translation of my Danish blog post, Bitcoin for voksne)

Bitcoin is a digital currency that has no central authority. It's a currency where you do not have to rely on anyone to know it's worth it. As a concept, it's similar to gold. Gold has a value in itself, as opposed to, say a $100 note that only has value if the U.S. government says it has value. Similarly, the idea of ​​Bitcoins is that they have value by themselves.

Let's try to understand how Bitcoin works.

View 0 basics.md

A series of posts on css-in-js

0. styles as objects

First, an exercise. Can we represent all of css with plain data? Let's try.

let redText = { color: 'red' };
View snippet.md

Avoid live "then()-ables"

Like a Promise, await will call any .then() function on its operand. This can be used to create values that change every time they are awaited.

let lastId = 1;
const id = {
  then(fn, errfn) {
    fn(lastId++);
  }
View index.md

Setup

Static files and 404 pages.

{{ mkdir "build" }}
{{ copy "static/*" "build" }}
{{ render "404" | write "build/404.html" }}