Skip to content

Instantly share code, notes, and snippets.

@scottjehl
scottjehl / noncritcss.md
Last active August 12, 2023 16:57
Comparing two ways to load non-critical CSS

I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.

TL;DR: Here's the solution I ended up with: https://github.com/filamentgroup/loadCSS/


For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: https://gist.github.com/igrigorik/2935269#file-notes-md ).

Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:

@staltz
staltz / introrx.md
Last active May 26, 2024 06:18
The introduction to Reactive Programming you've been missing

Stealing WiFi

/etc/hosts

This will let you access any google owned site. This includes: youtube, google cache, google translate, google search, gmail, google news, etc.

  • Install the HTTPS Everywhere extension
  • Add these rules to your /etc/hosts file
@WebReflection
WebReflection / String.prototype.template.js
Last active August 17, 2022 04:04
ES6 Template like strings in ES3 compatible syntax.
// this is now a module:
// https://github.com/WebReflection/backtick-template#es2015-backticks-for-es3-engines--
var template = require('backtick-template');
// just string
const info = 'template';
`some ${info}` === template('some ${info}', {info});
@kkemple
kkemple / konami-marionette-behavior.js
Last active July 9, 2021 20:14
Konami code Marionette Behavior
'use strict';
var Marionette = require('backbone.marionette'),
Konami;
Konami = Marionette.Behavior.extend({
defaults: {
code : [38, 38, 40, 40, 37, 39, 37, 39, 66, 65]
},
events: {
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@jamiebuilds
jamiebuilds / gulpfile.js
Last active December 21, 2015 12:51
Example single-file gulp setup
import {src, dest, watch, parallel, series} from 'gulp';
import lintPlugin from 'gulp-lint-plugin';
import testPlugin from 'gulp-test-plugin';
import buildPlugin from 'gulp-build-plugin';
const SRC_DIRECTORY = './src';
const TEST_DIRECTORY = './test';
const DIST_DIRECTORY = './dist';
const lintDir = dir => src(dir)
@jamiebuilds
jamiebuilds / gulpfile.js
Created October 5, 2015 20:45
Example multi-file gulp setup
export lint from './task-lint';
export test from './task-test';
export build from './task-build';
export dev from './task-dev';
export default dev;
@bcoe
bcoe / npm-top.md
Last active May 14, 2024 11:29
npm-top.md

npm Users By Downloads (git.io/npm-top)


npm users sorted by the monthly downloads of their modules, for the range May 6, 2018 until Jun 6, 2018.

Metrics are calculated using top-npm-users.

# User Downloads
@jamiebuilds
jamiebuilds / amicus-briefs-in-support-of-apple.md
Last active March 4, 2016 04:07
Amicus Briefs in Support of Apple

Amicus Briefs in Support of Apple

Companies

  • Airbnb [6]
  • Amazon.com [8]
  • Atlassian [6]
  • AT&T [19,20]
  • Automattic [6,7]
  • AVG Technologies [21]