Skip to content

Instantly share code, notes, and snippets.

View fmal's full-sized avatar
:octocat:
:octocat:‎ ‎‎‎ ‎ ‎:octocat:

Filip Malinowski fmal

:octocat:
:octocat:‎ ‎‎‎ ‎ ‎:octocat:
View GitHub Profile
.title-actions > .monaco-toolbar > .monaco-action-bar > .actions-container > .action-item > .action-label.icon.explorer-action {
display: none !important;
}
.editor-actions > .monaco-toolbar > .monaco-action-bar {
display: none !important;
}
function createNode(text) {
const node = document.createElement('pre');
node.style.width = '1px';
node.style.height = '1px';
node.style.position = 'fixed';
node.style.top = '5px';
node.textContent = text;
return node;
}
export default function humanReadableTimeDiff(date) {
var dateDiff = Date.now() - date;
if (dateDiff <= 0 || Math.floor(dateDiff / 1000) == 0) {
return 'now';
}
if (dateDiff < 1000 * 60) {
return Math.floor(dateDiff / 1000) + 's';
}
if (dateDiff < 1000 * 60 * 60) {
return Math.floor(dateDiff / (1000 * 60)) + 'm';
{
"Ansi 6 Color" : {
"Red Component" : 0.48627450979999998,
"Color Space" : "sRGB",
"Blue Component" : 0.94509803920000002,
"Alpha Component" : 1,
"Green Component" : 0.83529411760000005
},
"Tags" : [
const {true: a} = {
[x > 0]: 1,
[x < 0]: -1,
[x === 0]: 'wow'
};
/*
typeOf({}); // 'object'
typeOf([]); // 'array'
typeOf(function() {}); // 'function'
typeOf(/a/); // 'regexp'
typeOf(new Date()); // 'date'
typeOf(null); // 'null'
typeOf(undefined); // 'undefined'
typeOf('a'); // 'string'
typeOf(1); // 'number'
function lazyCompose(...fns) {
return fns.reverse().reduce(function reducer(fn1, fn2) {
return function composed(...args) {
return fn2(fn1(...args);
}
});
}
import {
curryN,
partialRight,
invoker
} from 'ramda';
const invoke = curryN(3, function invoke(arity, method, receiver) {
return partialRight(invoker(arity, method), [receiver]);
});
function getProductionUnitByKey (currentProductionUnitKey, bids) {
let result;
for (const key in bids) {
if (key === currentProductionUnitKey) {
return bids[key];
}
result = getProductionUnitByKey(currentProductionUnitKey, bids[key].children);
function withDefault (value, defaultValue) {
if (value === undefined || value === null) {
return defaultValue;
}
return value;
}
// const velocity = withDefault(config.velocity, 0);