Skip to content

Instantly share code, notes, and snippets.

🚀
I can see what you see not

Radu Micu radum

🚀
I can see what you see not
Block or report user

Report or block radum

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@radum
radum / README
Created Jan 23, 2019 — forked from joelambert/README
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
View README
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@radum
radum / redux-mini.js
Created Nov 13, 2018 — forked from jakoblind/redux-mini.js
A mini redux implementation
View redux-mini.js
/*
You need node 6.9 or later.
Run with:
node redux-mini.js --harmony
Want a more in depth explanation of how things works? Read the blog post I have written about it here:
http://blog.jakoblind.no/2017/03/13/learn-redux-by-coding-a-mini-redux/
*/
/*
@radum
radum / getOverlap.js
Created Oct 18, 2018 — forked from pankajpatel/getOverlap.js
Function to get the overlap between two elements
View getOverlap.js
/**
* isOverlapping() returns the overlapping status between two elements
* based on the passed in Element objects
*
* @param {Element, Element} Element object of DOM
* @return {Boolean|null} overlap status or null if native objet not received
*/
function isOverlapping(e1, e2){
if( e1.length && e1.length > 1 ){
e1 = e1[0];
@radum
radum / z-index.scss
Created Sep 27, 2018
z-index management
View z-index.scss
// From my boilerplate here: https://github.com/radum/webapp-boilerplate/blob/develop/src/styles/tools/_tools.z-index.scss
/**
* Check if map has nested keys
* @param {string} $map Key to find
* @param {object} $keys... Object of keys to look into
* @return {boolean} Return true or false if map has nested keys
*/
@function map-has-nested-keys($map, $keys...) {
@each $key in $keys {
View localStorage-proxy.js
Object.defineProperty(window, 'localStorage', {
configurable: true,
enumerable: true,
value: new Proxy(localStorage, {
set: function (ls, prop, value) {
console.log(`direct assignment: ${prop} = ${value}`);
debugger;
ls[prop] = value;
return true;
},
@radum
radum / http2.js
Created Sep 22, 2018 — forked from davidgilbertson/http2.js
HTTP2 server with compression and caching
View http2.js
const http2 = require('http2');
const fs = require('fs');
const path = require('path');
const zlib = require('zlib');
const brotli = require('brotli'); // npm package
const PORT = 3032;
const BROTLI_QUALITY = 11; // slow, but we're caching so who cares
const STATIC_DIRECTORY = path.resolve(__dirname, '../dist/');
const cache = {};
@radum
radum / error.js
Created Sep 6, 2018
Creating Custom Error Objects In Node.js With Error.captureStackTrace()
View error.js
// Require our core node modules.
var util = require( "util" );
// Export the constructor function.
exports.AppError = AppError;
// Export the factory function for the custom error object. The factory function lets
// the calling context create new AppError instances without calling the [new] keyword.
exports.createAppError = createAppError;
@radum
radum / devtools-monitor.js
Created May 11, 2018
Devtools protocol monitor in JS
View devtools-monitor.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'
}
}));
View whatismydayrate.md

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.

You can’t perform that action at this time.