Skip to content

Instantly share code, notes, and snippets.

View alinzk's full-sized avatar
🇵🇰

Ali alinzk

🇵🇰
View GitHub Profile
@alinzk
alinzk / machine.js
Created March 24, 2021 10:06
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@alinzk
alinzk / headCustom.js
Last active March 10, 2021 09:27
Customized Head from next.js to disable preloading JS and CSS assets
/*
NOTE: This modifies next.js internal api behavior and may break your application.
Tested on next.js version: 9.2.1
*/
import React from 'react';
import { Head } from 'next/document';
class HeadCustom extends Head {
@alinzk
alinzk / nextScriptCustom.js
Last active January 20, 2022 05:55
Customized NextScript from next.js to delay loading for non-critical js
/*
NOTE: This modifies next.js internal api behavior and may break your application.
Tested on next.js version: 9.2.1
*/
import React from 'react';
import { compact, flatten } from 'lodash';
import { NextScript } from 'next/document';