Skip to content

Instantly share code, notes, and snippets.

View luckylooke's full-sized avatar

Ctibor Laky luckylooke

View GitHub Profile
@luckylooke
luckylooke / angularMergePolyfill.js
Last active November 27, 2017 07:56
angular.merge polyfill for angular < 1.4.0
if (!angular.merge) {
angular.merge = (function mergePollyfill() {
function setHashKey(obj, h) {
if (h) {
obj.$$hashKey = h;
} else {
delete obj.$$hashKey;
}
}
@luckylooke
luckylooke / gmailFullAdressesInbox.js
Last active August 29, 2015 14:25
userscript for browsers to see full adresses in inbox on gmail.com, you can use greasemonkey or similiar software to run it.
// ==UserScript==
// @name Gmail: show full email addresses
// @namespace http://mail.google.com/
// @match *://*mail.google.com/*
// @exclude https://mail.google.com/*view=btop*
// @exclude https://accounts.google.com/*
// @version 0.3
// @description Gmail: showing full email addresses
// @copyright 2013+, Luckylooke
// ==/UserScript==
@luckylooke
luckylooke / ebayGBPtoEUR.js
Created July 25, 2015 10:12
userscript that converts all prices in GBP on site to EUR, you can use greasemonkey or similiar software to run it. I havent tested this recently.
// ==UserScript==
// @name Ebay GBP to EUR
// @namespace http://example.com/
// @match *://*ebay.co.uk/*
// @version 0.1
// @description converts all prices in GBP on site to EUR
// @copyright 2012+, Luckylooke
// ==/UserScript==
GM_log('script "Ebay GBP to EUR" is running');
@luckylooke
luckylooke / cellAutoVoronoi.js
Last active October 6, 2017 00:01
Rewriten library cellauto to make it work on diagrams generated by Raymond Hill voronoi library( https://github.com/gorhill/Javascript-Voronoi )
// rewriten from http://sanojian.github.io/cellauto/
function CellAutoVoronoiCell(index) {
this.index = index;
this.delays = [];
}
CellAutoVoronoiCell.prototype.process = function(neighbors) {
return;
};
@luckylooke
luckylooke / installYoCloud9.rm
Created January 1, 2016 14:55
Installing yeoman in cloud9 enviroment
// install latest stable node
nvm install stable
// install yoman
npm install -g yo
// yoman automaticly check enviroment via yoman doctor, copypaste sugested command into terminal
echo "export NODE_PATH=$NODE_PATH:/home/ubuntu/.nvm/versions/node/v5.3.0/lib/node_modules" >> ~/.bashrc && source ~/.bashrc
// you can check again that everything is OK now
yo doctor
@luckylooke
luckylooke / spinner.html
Last active April 5, 2017 16:44 — forked from jiripudil/spinner.html
Pure JavaScript spinner
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Pure JS spinner</title>
<style>
#spinner { font-size: 6em; }
</style>
</head>
@luckylooke
luckylooke / design.md
Last active June 15, 2017 07:10
Modern js library design

Modern js library design

How to design library the most efficient way?

Problem description

I have an idea about ideal lib design. But seems to be not easy to achieve it. I want to support [standard ES6 module], also other common use cases supported by [UMD]. BUT there is one more use case I want to support and so there is where the problem begins. I want to be able to switch parts of a library to different implementation.

USE CASE 1 - ES6 module

The library is provided as pure standard ES6 module, without UMD or similar bundler specific wraps.

@luckylooke
luckylooke / aliexpress-feedback.js
Last active April 2, 2021 07:21
User script (userscript) prefill 5-star rating in aliexpress feedback
// ==UserScript==
// @name Aliexpress feedback
// @namespace https://feedback.aliexpress.com/
// @version 1.1.0
// @description prefill 5-star rating in aliexpress feedback
// @author luckylooke
// @match https://feedback.aliexpress.com/management/leaveFeedback.htm*
// @grant none
// ==/UserScript==
@luckylooke
luckylooke / aliexpress-precheck.js
Created December 27, 2017 13:25
User Script - (userscript) precheck checkboxes in order detail
// ==UserScript==
// @name Aliexpress - precheck order detail
// @namespace https://aliexpress.com/
// @version 1.0.0
// @description precheck checkboxes in order detail
// @author luckylooke
// @match https://trade.aliexpress.com/order_detail.htm*
// @grant none
// ==/UserScript==
@luckylooke
luckylooke / recaptcha_fallback.js
Created August 21, 2019 13:24
Google recaptcha wrapper for grecaptcha.execute() with version 2 fallback.
function execute(action, callback) {
// create real promise, because execute method does not return the real one
// (missing documentation what actually returns)
const promise = new Promise((resolve, reject) => {
grecaptcha.ready(() =>
grecaptcha.execute(key, { action }).then(token => {
resolve(token);
},
reject)
);