Skip to content

Instantly share code, notes, and snippets.

@laggingreflex
laggingreflex / README.md
Created December 22, 2018 22:43
SSD M.2 vs HDD: Running npm install on a typically large NodeJS project

HDD

[![][HDD_gif]][HDD_link] ~ 1 minute 26 sec

SSD

[![][SSD_gif]][SSD_link] ~ 20 sec

The node_modules in this project consisted of ~16k files and ~70MB

import { spawn } from 'child_process'
const cp = spawn('node', ['pong.mjs'], { shell: true })
cp.stdout.pipe(process.stdout)
cp.stderr.pipe(process.stderr)
process.stdin.pipe(cp.stdin)
@laggingreflex
laggingreflex / Synaptics.reg
Created January 25, 2019 02:40
Disable Smartsense on Synaptics Touchpad
Windows Registry Editor Version 5.00
; See https://superuser.com/questions/1163025/no-option-to-disable-smartsense-in-synaptics-touchpad-driver/1384982#1384982
[HKEY_LOCAL_MACHINE\SOFTWARE\Synaptics\SynTP\Defaults]
"PalmKms0"=dword:00000000
"PalmKms0g"=dword:00000000
"PalmKms0p"=dword:00000000
"PalmKms1"=dword:00000000
"PalmKms1g"=dword:00000000
const serve = require('webpack-serve');
serve({ config: {} });
@laggingreflex
laggingreflex / gist:df28777a34d61e9f16dbb5b6e8120a81
Created March 20, 2018 20:15
SpaceSniffer Script for exporting grouped-by-folder file report but with only folders >10GB & files >100MB
if {<%isfile%>} == {true} ? {
if {<%disksizebytes%>} > {100000000} ?
{ [{leftpad{<%disksize%>}{ }{8}}] <%file%>{&br} }
}:{
if {<%containsfiles%>} == {true} ? {
if {<%disksizebytes%>} > {10000000000} ?
{ {&br}<%pathfile%> [<%disksize%>]{&br} }
}
}
"use strict";
const __non_webpack_module__ = module;
const __non_webpack_filename__ = __filename;
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
@laggingreflex
laggingreflex / markdown-js.html
Last active March 23, 2017 22:41
webpack bundles - difference between markdown-js vs marked - size comparison
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Webpack Bundle Analyzer</title>
<!-- viewer.js -->
<script>
@laggingreflex
laggingreflex / sort.js
Created November 16, 2016 14:17
Sort github comments by reactions
(() => {
const q = (e, s) => e.querySelector(s);
const qA = (e, s) => e.querySelectorAll(s);
const num = e => parseInt(e.nextSibling.wholeText.trim())
const d = document.querySelector('.js-discussion.js-socket-channel');
/* uncomment one of these to sort by */
const sortBy = '+1';
// const sortBy = '-1';
// const sortBy = 'smile';
@laggingreflex
laggingreflex / Readme.md
Created August 27, 2016 01:34
[Question] How to install ST3 on WSL? It gives this error

I tried installing

sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer

but it gives error (full error below)

... (skipping lines that were ok)

Setting up sublime-text-installer (3114-2webupd80) ...

@laggingreflex
laggingreflex / Readme.md
Created July 30, 2016 23:44
UglifyJsPlugin is preventing generation of sourcemaps in Webpack 2

Install & run:

npm i webpack@2.1.0-beta.20
./node_modules/.bin/webpack

Output with UglifyJsPlugin

           Asset     Size  Chunks             Chunk Names
    index.min.js  2.59 kB       0  [emitted]  main