Skip to content

Instantly share code, notes, and snippets.

View Comandeer's full-sized avatar
:octocat:
JavaScripting

Tomasz Jakut Comandeer

:octocat:
JavaScripting
View GitHub Profile
@Comandeer
Comandeer / README.md
Last active June 29, 2019 18:53
Simple utility to update supported Node versions in a project

update-node.js

Installation and usage

cd dir-with-cloned-update-node
npm i --no-save external-editor yaml
cd your-project
node path/to/update-node <min> <max> <branch>
function deepClone( obj ) {
const clone = { ...obj };
Object.entries( clone ).forEach( ( [ key, value ] ) => {
if ( value && typeof value === 'object' ) {
clone[ key ] = deepClone( value );
}
} );
return clone;
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<link id=Main-File rel=Main-File
@Comandeer
Comandeer / highlights.md
Last active November 15, 2018 00:24
Proposal for simplified API for range highlighting

Proposal for simplified API for range highlighting

::highlight(example-highlight) {
    background-color: yellow;
    color: blue;
}
@Comandeer
Comandeer / link-feature.md
Last active March 8, 2016 09:16
Link features in the popular WYSIWYG editors.
@Comandeer
Comandeer / enter.md
Created February 26, 2016 11:38
WYSIWYG support for Enter key.
@Comandeer
Comandeer / research.md
Created February 26, 2016 10:35
Template for WYSIWYG research
@Comandeer
Comandeer / areDeepEqual.js
Created February 16, 2016 09:24
YUITest.ObjectAssert.areDeepEqual method
// Based on http://yuilibrary.com/yui/docs/api/files/test_js_ObjectAssert.js.html#l12.
YUITest.ObjectAssert.areDeepEqual = function( expected, actual, message ) {
var expectedKeys = YUITest.Object.keys(expected),
actualKeys = YUITest.Object.keys(actual),
areEqual = YUITest.ObjectAssert.areEqual;
YUITest.Assert._increment();
// First check keys array length.
if ( expectedKeys.length != actualKeys.length ) {
@Comandeer
Comandeer / basicFeatures.md
Created December 6, 2015 19:23
Basic features in various WYSIWYGs
@Comandeer
Comandeer / iife.js
Created November 16, 2015 22:55
IIFE example
var isLocalStorageSupported = (function()
{
try
{
localStorage.setItem('test', 'test');
localStorage.removeItem('test');
return true;
}
catch(e)
{