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
View README.md

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>
View deep-clone-1.js
function deepClone( obj ) {
const clone = { ...obj };
Object.entries( clone ).forEach( ( [ key, value ] ) => {
if ( value && typeof value === 'object' ) {
clone[ key ] = deepClone( value );
}
} );
return clone;
View excel.html
<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
View highlights.md

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.
View link-feature.md
@Comandeer
Comandeer / enter.md
Created February 26, 2016 11:38
WYSIWYG support for Enter key.
View enter.md
@Comandeer
Comandeer / research.md
Created February 26, 2016 10:35
Template for WYSIWYG research
View research.md
@Comandeer
Comandeer / areDeepEqual.js
Created February 16, 2016 09:24
YUITest.ObjectAssert.areDeepEqual method
View areDeepEqual.js
// 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
View basicFeatures.md
@Comandeer
Comandeer / iife.js
Created November 16, 2015 22:55
IIFE example
View iife.js
var isLocalStorageSupported = (function()
{
try
{
localStorage.setItem('test', 'test');
localStorage.removeItem('test');
return true;
}
catch(e)
{