Skip to content

Instantly share code, notes, and snippets.

View BuddhikaGeasman's full-sized avatar
👾
Turning bugs into features and errors into easter eggs 🥚

Buddhika Geasman BuddhikaGeasman

👾
Turning bugs into features and errors into easter eggs 🥚
View GitHub Profile
@BuddhikaGeasman
BuddhikaGeasman / async-defer-module.md
Created November 7, 2023 20:16 — forked from jakub-g/async-defer-module.md
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)

@BuddhikaGeasman
BuddhikaGeasman / Readme.md
Created March 20, 2017 17:57 — forked from mxstbr/Readme.md
Enable tab completion for JSX with Emmet in Atom

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
{
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"plugins": [
"react"
],
"parserOptions": {
@BuddhikaGeasman
BuddhikaGeasman / gulpfile.js
Last active August 19, 2016 20:45
Gulp Set up
var gulp = require('gulp');
var sass = require ('gulp-sass');
var browserSync = require('browser-sync').create();
var reload = browserSync.reload;
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require ('babelify');