Skip to content

Instantly share code, notes, and snippets.

View jaandrle's full-sized avatar
🚀
Exploring

Jan Andrle jaandrle

🚀
Exploring
View GitHub Profile
@jaandrle
jaandrle / 0) JavaScritpt - Software design pattern.md
Last active September 10, 2018 11:35
JavaScritpt - Software design pattern
@jaandrle
jaandrle / 0) JavaScript - Tips & Tricks - Content.md
Last active September 25, 2020 10:56
JavaScript - Tips & Tricks

READ ME

This is in-browser JavaScript code which provide possibility to quick get information from Trello dashboard.

It was tested mainly on Firefox.

The Classes_GetTrelloStuff implementation is necessary pasted to browser console. The class has now two methods "toJSON" and "toMarkdown" (primary for GitHub).

The class allow to decide which cols schould be exported. In constructor use param "col_list_min" (indexing starts by 0) and "col_list_max" (the same as "col_list_min" or string like "rest" which represents rest cols).

/*
Final results 3 x test(258) + 3 x test(NodeList(length=258)) - Android7 WebView
Original: for 3x faster than forEach and 10% times is quicker
$iterable2=for inside function
Own vs for (only $iterable2 make sence): for 0.9x slower than $iterable2 and quicker in 3/10 vs 3.333/10
=== All Results - Average ===
Delays: [394.3333333333333, 43.166666666666664, 150.66666666666666, 38.333333333333336]
Winners: ["2.5times", "3times", "2times", "3.3333333333333335times"]
@jaandrle
jaandrle / gist:8ce7f40202fb59b96f429ee15ea1b975
Created September 10, 2018 07:59 — forked from juandopazo/gist:2901426
Privates and WeakMaps
// Based on a gist by @rwaldron
// https://gist.github.com/2897761
function privatize() {
var map = new WeakMap();
return function private(obj) {
var data = map.get(obj);
if (!data) {
map.set(obj, data = {});
}
@jaandrle
jaandrle / PubSub-Topics.js
Last active April 8, 2022 13:11
Just another version of PubSub
/* jshint esversion: 6,-W097, -W040, browser: true, expr: true, undef: true, devel: true */
/**
* Event info shared across multiple `publish` calls (e. g. topic name).
*
* @typedef pubsub_TopicInfo
* @property {string} [name] Event name/identification.
* */
/**
* Topic(s) options and topic **refence** to be used in subscribe/publish/… functions.
*
@jaandrle
jaandrle / bg.js
Last active January 28, 2020 20:13
node /bin/bg cordova run
/* jshint esversion: 6,-W097, -W040, node: true, expr: true, undef: true */
const /* utils */
{ max, round }= Math,
{ spawn }= require('child_process'),
{ writeFileSync, readFileSync }= require("fs");
const /* runtime arguments and cwd */
[ cmd, ...cmd_arguments ]= process.argv.slice(2),
cwd= process.cwd();
let iteration= -1;
const /* animation */