Skip to content

Instantly share code, notes, and snippets.

Ctibor Laky luckylooke

View GitHub Profile
@luckylooke
luckylooke / change_captcha_v2_lang.js
Created Aug 22, 2019
Changing reCAPTCHA v2 lang dynamically
View change_captcha_v2_lang.js
function setCaptchaLang(lang) {
const container = document.getElementById('captcha_container');
// Get GoogleCaptcha iframe
const iframeGoogleCaptcha = container.querySelector('iframe');
// Get language code from iframe
const actualLang = iframeGoogleCaptcha.getAttribute("src").match(/hl=(.*?)&/).pop();
@luckylooke
luckylooke / recaptcha_fallback.js
Created Aug 21, 2019
Google recaptcha wrapper for grecaptcha.execute() with version 2 fallback.
View recaptcha_fallback.js
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)
);
@luckylooke
luckylooke / aliexpress-precheck.js
Created Dec 27, 2017
User Script - (userscript) precheck checkboxes in order detail
View aliexpress-precheck.js
// ==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 / aliexpress-feedback.js
Last active Jul 22, 2017
User script (userscript) prefill 5-star rating in aliexpress feedback
View aliexpress-feedback.js
// ==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 / design.md
Last active Jun 15, 2017
Modern js library design
View design.md

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 / spinner.html
Last active Apr 5, 2017 — forked from jiripudil/spinner.html
Pure JavaScript spinner
View spinner.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Pure JS spinner</title>
<style>
#spinner { font-size: 6em; }
</style>
</head>
@luckylooke
luckylooke / installYoCloud9.rm
Created Jan 1, 2016
Installing yeoman in cloud9 enviroment
View installYoCloud9.rm
// 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 / cellAutoVoronoi.js
Last active Oct 6, 2017
Rewriten library cellauto to make it work on diagrams generated by Raymond Hill voronoi library( https://github.com/gorhill/Javascript-Voronoi )
View cellAutoVoronoi.js
// rewriten from http://sanojian.github.io/cellauto/
function CellAutoVoronoiCell(index) {
this.index = index;
this.delays = [];
}
CellAutoVoronoiCell.prototype.process = function(neighbors) {
return;
};
@luckylooke
luckylooke / ebayGBPtoEUR.js
Created Jul 25, 2015
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.
View ebayGBPtoEUR.js
// ==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 / gmailFullAdressesInbox.js
Last active Aug 29, 2015
userscript for browsers to see full adresses in inbox on gmail.com, you can use greasemonkey or similiar software to run it.
View gmailFullAdressesInbox.js
// ==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==
You can’t perform that action at this time.