Skip to content

Instantly share code, notes, and snippets.

View radum's full-sized avatar
🚀
I can see what you see not

Radu Micu radum

🚀
I can see what you see not
View GitHub Profile
@radum
radum / devtools-monitor.js
Created May 11, 2018 08:58
Devtools protocol monitor in JS
const ws = new WebSocket('http://localhost:9222/json');
ws.on('open', () => {
ws.send(JSON.stringify({
id: 1,
method: 'Runtime.evaluate',
params: {
expression: 'document.title'
}
}));

Enter your desired gross annual salary

£80,000

Your day rate should be: £540 Hourly, that's: £67

See how we calculated this (it’s not £80,000/365). You can change all of these variables to whatever works for you.

@radum
radum / unistore.js
Created March 6, 2018 09:01
developit/unistore Example
import createStore from "unistore";
function mapActions(actions, store) {
if (typeof actions === "function") actions = actions(store);
let mapped = {};
for (let i in actions) {
mapped[i] = store.action(actions[i]);
}
return mapped;
}
<!doctype html>
<!--
The Annoying Site
https://theannoyingsite.com
Author:
Feross Aboukhadijeh
https://feross.org
@radum
radum / A Web performance resources.md
Last active September 4, 2024 21:49
Web performance resources
@radum
radum / fitgrid.css
Created September 14, 2017 07:43
Fitgrid - CSS Grid
/*
_______ ___ _______ _______ ______ ___ ______
| || | | | | || _ | | | | |
| ___|| | |_ _| | ___|| | || | | | _ |
| |___ | | | | | | __ | |_||_ | | | | | |
| ___|| | | | | || || __ || | | |_| |
| | | | | | | |_| || | | || | | |
|___| |___| |___| |_______||___| |_||___| |______|
by Dave Rupert
Read More: https://daverupert.com/2017/09/breaking-the-grid/
@radum
radum / monitoring-jank.js
Last active June 16, 2017 12:19 — forked from l8on/monitoring-jank.coffee
Monitoring Jank Example
// From here https://gist.github.com/l8on/7378d518a001a87adaf42a00fb7e50be#file-monitoring-jank-coffee
// https://fulcrum.lever.co/monitoring-jank-how-we-found-the-slowest-parts-of-our-ui-b6ffd7386896
var isModernBrowser, isNative, setupJankTracking;
// Simple function that uses a heuristic to tell if a function
// is native code. Luckily this isn't security related code.
isNative = function(fn) {
return /\{\s*\[native code\]\s*\}/.test("" + fn);
};
@radum
radum / polyfill.document.createTreeWalker.js
Created May 16, 2017 10:30
polyfill.document.createTreeWalker.js
/* eslint no-param-reassign: 0 */
/**
* JavaScript implementation of W3 DOM4 TreeWalker interface.
*
* See also:
* - https://dom.spec.whatwg.org/#interface-treewalker
*
* Attributes like "read-only" and "private" are ignored in this implementation
* due to ECMAScript 3 (as opposed to ES5) not supporting creation of such properties.
@radum
radum / isNumber.html
Created September 19, 2016 10:07
isNumber Test Cases
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>QUnit Tests</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript" src="testrunner.js"></script>
<link rel="stylesheet" href="testsuite.css" type="text/css" media="screen" />
<script language="JavaScript" type="text/javascript">
@radum
radum / commands.zsh
Last active February 14, 2018 20:22
Useful CLI stuff
# Windows copy with permissions
# https://www.maketecheasier.com/12-things-you-must-do-when-running-a-solid-state-drive-in-windows-7/
Robocopy.exe H:\Internet M:\Internet /MIR /copyall /dcopy:T /W:30
# Change how many max files the system can use
# https://superuser.com/questions/827984/open-files-limit-does-not-work-as-before-in-osx-yosemite
# https://blogs.progarya.dk/blog/how-to-persist-ulimit-settings-in-osx/
sudo sysctl -w kern.maxfiles=65000
sysctl kern.maxfiles