Skip to content

Instantly share code, notes, and snippets.

@SilverEzhik
SilverEzhik / Twitter instant block.js
Last active October 19, 2018 21:29
Block people on the hell website with one less click
// ==UserScript==
// @name Twitter instant block
// @description Block people on the hell website with one less click
// @include https://twitter.com/*
// @version 1
// @grant none
// ==/UserScript==
// using mozilla sample code
// https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
@SilverEzhik
SilverEzhik / YouTube full-height theater.css
Last active January 5, 2019 00:37
YouTube full-height theater
:root {
--bar-height: 23px;
--bar-height-orig: 56px;
}
ytd-app[is-watch-page=""] #player-theater-container {
min-height: calc(100vh - var(--bar-height)) !important;
}
ytd-app[is-watch-page=""]:not([masthead-hidden_=""]) #page-manager {
margin-top: var(--bar-height) !important;
}
@SilverEzhik
SilverEzhik / middleclick.c
Created August 31, 2018 02:44
This small program performs a middle click on macOS - stick this in an Automator service and you can get a shortcut to perform a middle click!
#include <ApplicationServices/ApplicationServices.h>
int main() {
// get pointer location
CGEventRef ourEvent = CGEventCreate(NULL);
CGPoint point = CGEventGetLocation(ourEvent);
CFRelease(ourEvent);
// button down
CGEventRef click1_down = CGEventCreateMouseEvent(
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
const int LEFT = 4;
const int UP = 2;
const int RIGHT = 6;
const int DOWN = 8;