Skip to content

Instantly share code, notes, and snippets.

@chriskrycho
chriskrycho / load.js
Last active October 10, 2023 10:47
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
@terafin
terafin / UniFi USG DNS Redirect Setup.md
Last active April 19, 2024 21:40
UniFi USG DNS Redirect Setup
  1. Log into unifi controller web UI
  2. Go to Settings
  3. Select Routing & Firewall
  4. Select Firewall
  5. Select Groups
  6. Hit "Create new Group"
  7. Enter all your DNS servers here you want to be allowed on the local LAN (Eg, mine is 10.0.1.1 - gateway, 10.0.1.14 - pi-hole)
  8. Name this "Allowed DNS Servers"
  9. Hit OK
  10. SSH into the Gateway - NOT the CloudKey (username/password is whatever you set up)
@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 July 27, 2024 23:38
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 May 6, 2024 07:45
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");