Skip to content

Instantly share code, notes, and snippets.

View darky's full-sized avatar
💨

Vladislav Botvin darky

💨
  • Moscow
  • 18:49 (UTC +03:00)
View GitHub Profile
moneyMovesNodes = document.querySelectorAll('.moneyText');
i = 0;
byPlaces = {};
$(document).ajaxSuccess(() => requestAnimationFrame(() => {
const places = Array.from(document.querySelectorAll('.CLIP')).filter((_, i) => i % 2 === 0).map(n => n.textContent);
const moneyMoves = Array.from(document.querySelectorAll('.RED_AMOUNT,.GREEN_AMOUNT'))
.map(n => parseFloat(n.outerText.replace(/[^\d\+\-\,]/g, '').replace(',', '.')));
places.forEach((p, i) => byPlaces[p] = (byPlaces[p] || 0) + moneyMoves[i])
const more = document.querySelector('.accountMovementsBoxPager tr:nth-child(2) td:nth-child(4):not(.DISABLED) > a');
if (more) {
{
"pro": true,
"plugins": [
"jsdom-quokka-plugin",
"quokka-mocha-bdd"
],
"env": { "params": { "env": "TS_NODE_TRANSPILE_ONLY=true;NODE_ENV=development;DEBUG=*" } },
"jsdom": {
"config": {
"url": "http://localhost"
@darky
darky / Chrome 56 devtools source maps to workspace.js
Last active February 8, 2017 09:56
Run chrome with --remote-debugging-port=9222 | Open tab with your project and there devtools | Open new tab localhost:9222 and there to devtools of devtools prev tab | Inject in Console below code | Refresh devtools
SDK.TextSourceMap.prototype._parseSources = function(sourceMap) {
var sourcesList = [];
var sourceRoot = sourceMap.sourceRoot || '';
if (sourceRoot && !sourceRoot.endsWith('/'))
sourceRoot += '/';
for (var i = 0; i < sourceMap.sources.length; ++i) {
var href = sourceRoot + sourceMap.sources[i];
var url = Common.ParsedURL.completeURL(this._sourceMappingURL, href) || href;
var source = sourceMap.sourcesContent && sourceMap.sourcesContent[i];
/*if (url === this._compiledURL && source)
@darky
darky / Chrome 51 devtools source maps to workspace.js
Last active May 31, 2016 10:17
Run chrome with --remote-debugging-port=9222 | Open tab with your project and there devtools | Open new tab localhost:9222 and there to devtools of devtools prev tab | Inject in Console below code | Refresh devtools
WebInspector.TextSourceMap.prototype._parseMap = function(map, lineNumber, columnNumber) {
var sourceIndex = 0;
var sourceLineNumber = 0;
var sourceColumnNumber = 0;
var nameIndex = 0;
var sources = [];
var names = map.names || [];
var sourceRoot = map.sourceRoot || "";
if (sourceRoot && !sourceRoot.endsWith("/"))
sourceRoot += "/";
@darky
darky / Chrome 50 devtools source maps to workspace.js
Last active May 31, 2016 10:08
Run chrome with --remote-debugging-port=9222 | Open tab with your project and there devtools | Open new tab localhost:9222 and there to devtools of devtools prev tab | Inject in Console below code | Refresh devtools
WebInspector.SourceMap.prototype._parseMap = function(map, lineNumber, columnNumber)
{
var sourceIndex = 0;
var sourceLineNumber = 0;
var sourceColumnNumber = 0;
var nameIndex = 0;
var sources = [];
var sourceRoot = map.sourceRoot || "";
if (sourceRoot && !sourceRoot.endsWith("/"))
sourceRoot += "/";
@darky
darky / touchegg.xml
Last active February 16, 2016 16:03
Touchegg like OS X
<touchégg>
<settings>
<property name="composed_gestures_time">0</property>
</settings>
<application name="All">
@darky
darky / virtual_class.coffee
Last active January 9, 2023 21:37
Multiple inheritance in Coffeescript. This little helper make proper prototype chain and call `super`. Existing classes in chain not violated, uses theirs "projections". Мультинаследование в Coffeescript. Этот маленький хелпер создаёт корректную цепочку прототипов с правильным вызовом `super`. Существующие классы не портятся, используются их "пр…
virtual_class = (classes...)->
classes.reduceRight (Parent, Child)->
class Child_Projection extends Parent
constructor: ->
# Temporary replace Child.__super__ and call original `constructor`
child_super = Child.__super__
Child.__super__ = Child_Projection.__super__
Child.apply @, arguments
Child.__super__ = child_super