Skip to content

Instantly share code, notes, and snippets.

View Matthew-Burfield's full-sized avatar
🏠
Working from home

Matthew Burfield Matthew-Burfield

🏠
Working from home
View GitHub Profile
@Matthew-Burfield
Matthew-Burfield / remove-immutable.md
Created May 10, 2023 06:44 — forked from guilhermebruzzi/remove-immutable.md
Remove Immutable JS from your source code

I decided to remove all Immutable code on our big project because it wasn't causing our React to render less (using selectors on our redux layer was actually better).

Since our project has tests to check if everything is still working, I was able to achieve that with the following steps:

Search on all files on vscode or any editor with Use Regular Expression option (command+alt+r on vscode):

(Immutable|\.(size|count\(|toJS(?!\w)|fromJS(?!\w)|first[\(\)]|get\(|set\(|findEntry\(|getIn\(|setIn\(|contains\(|delete\(|asImmutable|add\())

Then on each find that was actually from a Immutable code:

  • Remove Immutable imports
{
"hash": "7aea43f473a03e1315e6",
"version": "5.23.0",
"time": 3059,
"builtAt": 1613763466730,
"publicPath": "auto",
"outputPath": "/home/matthew/Development/webpack/dist",
"assetsByChunkName": {
"index": ["index.bundle.js"],
"another": ["another.bundle.js"]
{
"hash": "ebac517150268511e705",
"version": "5.23.0",
"time": 2114,
"builtAt": 1613762996053,
"publicPath": "auto",
"outputPath": "/home/matthew/Development/webpack/dist",
"assetsByChunkName": {
"index": ["index.bundle.js"],
"another": ["another.bundle.js"]
" Vim colorscheme template file
" Author: Matthew Burfield <burfie@hotmail.com>
" Maintainer: Matthew Burfield <burfie@hotmail.com>
" Notes: To check the meaning of the highlight groups, :help 'highlight'
" --------------------------------
" set background=dark
" - or ---------------------------
" set background=light
" --------------------------------
@Matthew-Burfield
Matthew-Burfield / __MAGIKCRAFT__.Matthew-Burfield.magikcraft_spells.md
Last active August 12, 2017 04:02
Magikcraft Spells, by Matthew-Burfield.
@Matthew-Burfield
Matthew-Burfield / flags.html
Created June 10, 2017 00:05
force directed graph flags
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Show National Contiguity With A Force Directed Graph</title>
<link rel="stylesheet" href="flags.css">
<style>
@Matthew-Burfield
Matthew-Burfield / imgur.js
Created April 25, 2017 11:53 — forked from cecilemuller/imgur.js
Search images using the Imgur API
'use strict';
/* global XMLHttpRequest */
/* global process.env.API_IMGUR */
const querystring = require('querystring');
/**
* Fetches a page of results from the Imgur API.
*
* @param {String} options.q Query
const magik = magikcraft.io;
const material = org.bukkit.Material;
const player = magik.getSender();
function generateDungeon() {
const X = "X";
const array = [
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,X,X,0,0,0,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
const magik = magikcraft.io;
function clightning(num = 10, time = 1000) {
magik.doNTimes(
castLightning,
num,
() => writeMessage(num),
time,
);
}
const magik = magikcraft.io;
function clightning(num = 1, time = 100) {
magik.doNTimes(magik.shakti(), num, () => {
magik.dixit('Chain Lightning Is Finished');
}, time);
}