Skip to content

Instantly share code, notes, and snippets.

View SilverEzhik's full-sized avatar
🦔

Ezhik SilverEzhik

🦔
View GitHub Profile
@SilverEzhik
SilverEzhik / sleepNag.lua
Last active December 21, 2024 16:23
A Hammerspoon script that will nag you to go to sleep once a minute from 00:30 to 06:00.
--[[
A little script by Ezhik (https://ezhik.me) to get you to go to sleep already.
Import it in your Hammerspoon config like this:
```lua
sleepNag = require("sleepNag")
```
Then it'll kick in between 00:30 and 06:00 once a minute, reminding you to GO TO SLEEP.
@SilverEzhik
SilverEzhik / Mac OS Mojave Language Switcher (+ more) Dark Menu Bar Fix.txt
Created July 10, 2019 11:32
To fix the language switcher and other stuff like the notifications and Spotlight in Mac OS with hybrid dark mode (dark menu bar and light theme apps), do this.
To fix the language switcher and other stuff like the notifications and Spotlight in Mac OS with hybrid dark mode (dark menu bar and light theme apps), do this:
defaults write com.apple.HIToolbox NSRequiresAquaSystemAppearance -bool no
defaults write com.apple.notificationcenterui NSRequiresAquaSystemAppearance -bool no
defaults write com.apple.menuextra.textinput NSRequiresAquaSystemAppearance -bool no
defaults write com.apple.TISwitcher NSRequiresAquaSystemAppearance -bool no
defaults write com.apple.Spotlight NSRequiresAquaSystemAppearance -bool no
@SilverEzhik
SilverEzhik / Vim Launcher.scpt
Last active May 13, 2023 14:17 — forked from charlietran/TerminalVim.scpt
Double click files to open them in vim in a new iTerm window.
on run {input, parameters}
-- handle opening multiple files
set str to ""
repeat with i from 1 to length of input
set cur to item i of input
set str to str & " " & quote & POSIX path of cur & quote
end repeat
tell application "iTerm"
create window with profile "fast" -- use a profile with a lighter shell
@SilverEzhik
SilverEzhik / Disable Homebrew auto-update every time you run it.md
Last active February 6, 2020 14:47
Disable Homebrew auto-update every time you run it

Homebrew does something annoying and does its long update process almost every time you run it, which is irritating.

Here's a way to fix it while still keeping auto-updating on.

Add this to your .bashrc or equivalent:

HOMEBREW_NO_AUTO_UPDATE=1
@SilverEzhik
SilverEzhik / Fix DuckDuckGo middle click.js
Last active August 29, 2019 14:59
Fix DuckDuckGo middle click. What the heck is that JavaScript madness?
// ==UserScript==
// @name Fix DuckDuckGo middle click
// @description What the heck is that JavaScript madness?
// @include https://*duckduckgo.com/*
// @version 1
// @grant none
// @run-at document-idle
// ==/UserScript==
function undoClicky() {
@SilverEzhik
SilverEzhik / Disable Dark Mode in Firefox.txt
Created July 10, 2019 11:21
If you are using Firefox and a dark theme on your OS, to prevent the prefers-color-scheme media query from making websites go dark, do this.
If you are using Firefox and a dark theme on your OS, to prevent the prefers-color-scheme media query from making websites go dark, do this:
1. Go to about:config
2. Right Click > New > Integer
3. Set it to:
Name - ui.systemUsesDarkTheme
Value - 0
Then restart Firefox.
@SilverEzhik
SilverEzhik / Disable YouTube Autoplay.js
Last active April 21, 2019 20:10
YouTube is annoying in persistently switching autoplay back on, probably due to my cookie shennanigans, this fixes that.
// ==UserScript==
// @name Disable YouTube Autoplay
// @version 1
// @grant none
// @include https://*youtube.com/*
// @run-at document-idle
// ==/UserScript==
function fix() {
var a = document.getElementById("toggle");
@SilverEzhik
SilverEzhik / no.js
Last active February 20, 2019 06:16
write-only twitter
// ==UserScript==
// @name No
// @include *twitter.com/*
// @run-at document-start
// ==/UserScript==
function no() {
var x = window.location;
if (x == "https://twitter.com/home" || x == "https://twitter.com/") {
x.replace("https://twitter.com/dril/status/922321981");
@SilverEzhik
SilverEzhik / Discourse Enhancer.js
Last active February 12, 2019 05:02
A strange game. The only winning move is not to play.
// ==UserScript==
// @name Discourse Enhancer
// @description A strange game. The only winning move is not to play.
// @version 1
// @run-at document-start
// @grant none
// @include *://*reddit.com/r/all/
// @include *://news.ycombinator.com/item*
@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;
}