Skip to content

Instantly share code, notes, and snippets.

@cheater
cheater / sleep-countdown
Created Nov 18, 2018
sleep with countdown in bash
View sleep-countdown
#!/bin/bash
sleep_time="$(( $1 - 1 ))" # subtract 1, since we wait on the 0th second.
start_s="$(date +%s)"
start_ns="$(date +%N)"
div_whole() {
# whole-number division of integers.
a="$1"
@cheater
cheater / firefox.ahk
Created Sep 1, 2020
Firefox quick tab switching and search - AutoHotKey script
View firefox.ahk
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
; Only allow one instance of this script to run. If this script is run again,
; replace the old instance with the new one.
#SingleInstance Force
@cheater
cheater / CRT_Yee65.fx
Last active Jul 18, 2020
This is my Retro CRT preset for ReShade.
View CRT_Yee65.fx
/*
Ripped from Sonic Mania
*/
#include "ReShade.fxh"
@cheater
cheater / user.py.diff
Created Jul 27, 2012
saltstack salt #1704
View user.py.diff
diff --git a/tmp/user.py.orig b/usr/share/pyshared/salt/states/user.py
index ef27816..b6dc24d 100644
--- a/tmp/user.py.orig
+++ b/usr/share/pyshared/salt/states/user.py
@@ -101,6 +101,7 @@ def present(
name,
uid=None,
gid=None,
+ gid_from_name=False,
groups=None,