Skip to content

Instantly share code, notes, and snippets.

@chriskrycho
chriskrycho / load.js
Last active November 5, 2024 19:19
An auto-tracked AsyncData and load helper (with no proxies!)
import { tracked } from '@glimmer/tracking';
import { helper } from '@ember/component/helper';
import { action } from '@ember/object';
/**
* @template T
* @type {WeakMap<Promise<T>, AsyncData<T, any>>}
*/
const PROMISE_STATE = new WeakMap();
module.exports = {
defaultBrowser: 'Safari',
handlers: [
// Anything localhost should open in Edge
{
match: finicky.matchHostnames(['localhost']),
browser: 'Microsoft Edge',
},
// Launch Google Meet on my third user account
@lukemelia
lukemelia / app_transitions_concurrent.js
Created January 2, 2016 06:57
composing transitions in liquid-fire
import { Promise } from 'liquid-fire';
import { animationFor } from '../utils/transition-helpers';
// `concurrent` is not, by itself, an animation. It exists to run two or more
// transitions concurrently.
export default function concurrent(...transitions) {
return Promise.all(transitions.map((transition) => {
return runAnimation(this, transition);
}));
@paulirish
paulirish / what-forces-layout.md
Last active April 8, 2026 08:14
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@evanpurkhiser
evanpurkhiser / PowerlineSymbols.otf
Created August 10, 2013 02:38
Monaco Powerline fixed
@barryvdh
barryvdh / _ide_helper.php
Last active December 21, 2025 15:33
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");