Skip to content

Instantly share code, notes, and snippets.

View dentuzhik's full-sized avatar
🏠
Working from home

Denis Tuzhik dentuzhik

🏠
Working from home
  • Tallinn, Estonia
  • 12:47 (UTC +02:00)
View GitHub Profile
module.exports = {
extends: [
'airbnb',
'prettier',
],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
ecmaFeatures: {
@dentuzhik
dentuzhik / sVimrc
Last active September 13, 2018 09:51
sVimrc
let blacklists = ["*://mail.google.com/*", "*://mail.yandex.ru/*", "*://photos.google.com/*", "*://docs.google.com/*", "*://trello.com/*", "*://appleid.apple.com/*", "*://taxify.atlassian.net/*"];
let scrollstep = 200
set nosmoothscroll
curl 'https://revalsport.ee/core/wp-admin/admin-ajax.php' -H 'cookie: wordpress_sec_3f51ba3cfa9f99217c45f02bb0bffe9c=1755%7C1508493467%7CaCGrdOyzV3xMDg4uIg42ltzf244nSutIjwruFCLRdrc%7C798d3bbcc1d7a6489560f35fa305c230a3b3ef5274b281a2f112835992033445; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_3f51ba3cfa9f99217c45f02bb0bffe9c=1755%7C1508493467%7CaCGrdOyzV3xMDg4uIg42ltzf244nSutIjwruFCLRdrc%7C94193fe9fe76db2955b5acc7c72d9dc61a7af139f17cf3303b87e24131cdffb4; 75_Liitu10=true; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_3f51ba3cfa9f99217c45f02bb0bffe9c=1755%7C1508493467%7CaCGrdOyzV3xMDg4uIg42ltzf244nSutIjwruFCLRdrc%7C94193fe9fe76db2955b5acc7c72d9dc61a7af139f17cf3303b87e24131cdffb4; _icl_current_language=et; _gat=1; _ga=GA1.2.846093033.1507399352; _gid=GA1.2.2074483748.1508227733; _gat_UA-105765874-1=1; ju_v=3.6; _ju_dc=b23163e0-ab89-11e7-97bd-231bc37b8c04; _ju_pn=5' -H 'origin: https://revalsport.ee' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-US,en;q=0.8,ru;q=0.6' -
function increasePrice(number) {
for (let i = 0; i < number; i++) {
document.getElementById('btnRaisePrice').click()
}
}
function decreasePrice(number) {
for (let i = 0; i < number; i++) {
document.getElementById('btnLowerPrice').click()
}
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.012 000.012: --- VIM STARTING ---
000.116 000.104: Allocated generic buffers
000.358 000.242: locale set
000.361 000.003: clipboard setup
var getPaths = function({ name, children = [] }) {
// concat with spread(...) flattens nested arrays
var childrenPaths = [].concat(...children.map(getPaths)).map(path => `${name}/${path}`);
return [name].concat(childrenPaths);
};
@dentuzhik
dentuzhik / evil.html
Created October 16, 2015 11:28
Kill your browser tab creatively
<!DOCTYPE html>
<html>
<body>
<script id="foo">
eval(document.getElementById('foo').textContent);
</script>
</body>
</html>
@dentuzhik
dentuzhik / depower.js
Last active August 29, 2015 14:09
Given a value, finds the first base number and and a power, so base ^ power = value.
var cache = cache || {};
function cacheCheck(n) {
if (Object.keys(cache).indexOf(n) > -1) {
return cache[n];
}
};
// Both strategies won't behave as expected, due to incorrect division on large numbers
function safeIntegerCheck(n) {
@dentuzhik
dentuzhik / es6-resources
Created October 25, 2014 12:34
Concise list of ES6 resources
General information:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla
https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_7_support_in_Mozilla
http://www.2ality.com/2014/08/es6-today.html
http://ariya.ofilabs.com/2013/05/es6-and-block-scope.html (and related posts)
Modules:
www.2ality.com/2014/09/es6-modules-final.html
Spec:
@dentuzhik
dentuzhik / force_opera_repaint.js
Last active December 15, 2015 02:19
Force Opera Repaint
var forceOperaRepaintElement = function(el) {
if (window.opera) {
el.style.position = "relative";
window.setTimeout(function() {
el.style.position = "absolute";
}, 0);
}
};