Skip to content

Instantly share code, notes, and snippets.

View ivankolesnik's full-sized avatar

Ivan Kolesnik ivankolesnik

View GitHub Profile
@ivankolesnik
ivankolesnik / watcher-loader.js
Created July 19, 2016 13:19
Watch for async loaded remote scripts
/*
* This is a function that watches global variable
* Used to track asynchronously loaded remote scripts that do not have 'onload' callbacks
* When variable is created, callback {name}AsyncInit will be called
* And this 'watcher' will be replaced by real object
*
* Usage:
* window.somelibAsyncInit = function(somelib){...}
* window.__loadAsync('somelib')
*
@ivankolesnik
ivankolesnik / google-sign-in-window-onclose.js
Created July 27, 2016 17:57
Watch for closed Google Sign In oauth window
/*
* This is a snippet used to track Google Sign In oauth window
* Based on this comment https://github.com/google/google-api-javascript-client/issues/25#issuecomment-76695596
* You can wrap this into function to use promises, timeouts etc
* Shame on you, Google!
*/
// Get current open function
var winOpen = window.open;
// Regexp to valiate if it is really Googe Oauth page
@ivankolesnik
ivankolesnik / new-overclockers-anti-adblock-rules-for-ublock.txt
Last active April 8, 2019 12:30
Hide New Overclockers ad blocks in addition to uBlock Origin filters
! Minimum width is 80%
overclockers.ru##body > .ui.container.main-wrap:style(min-width: 80%)
! News columns are wider than articles
overclockers.ru##.ui.grid > .five.wide.column:nth-of-type(2):style(width: 50% !important)
overclockers.ru##.ui.grid > .eleven.wide.column:nth-of-type(3):style(width: 50% !important)
! Return links underline in articles
overclockers.ru##.sixteen.wide.column.container-block > .ui.grid.material-content a:style(text-decoration: underline !important)
@ivankolesnik
ivankolesnik / youtube-logo-subscriptions.js
Last active July 25, 2018 21:02
Replace YouTube logo URL to subscriptions
(function(window) {
function setDestination(event) {
var url;
var data;
var parent;
var target;
target = event.target;
if (!(data = target.data)) {
// This script is not mine. For source look into here:
// https://cable.ayra.ch/tampermonkey/view.php?script=youtube_old_design.user.js
(function () {
var getDesignCookie = function (cookie) {
//Find existing preferences
var prefs = cookie.split("; ").filter(function (v) {
return v.indexOf("PREF=") === 0;
})[0];
//No preferences, return new ones with design setting
if (!prefs) {