Skip to content

Instantly share code, notes, and snippets.

View DanH42's full-sized avatar

Dan Hlavenka DanH42

View GitHub Profile
/* ==UserStyle==
@name Fastmail - UI Tweaks
@namespace gist.github.com/DanH42
@version 1.2.0
@description Makes Fastmail look a little more like the good parts of Gmail
@author Dan Hlavenka
@updateURL https://gist.github.com/DanH42/3cd55863c9628689f16a2da4c6c8c790/raw
@preprocessor less
==/UserStyle== */
@DanH42
DanH42 / Dockerfile
Last active January 10, 2019 22:12
Alpine on Alpine
FROM alpine
RUN apk add --no-cache wget build-base ncurses-dev openssl-dev
RUN wget -qO /tmp/alpine-2.21.tar.xz http://alpine.x10host.com/alpine/release/src/alpine-2.21.tar.xz
RUN tar xf /tmp/alpine-2.21.tar.xz -C /tmp && rm /tmp/alpine-2.21.tar.xz
WORKDIR /tmp/alpine-2.21
RUN ./configure && make && make install
RUN ln -s alpine /usr/local/bin/pine
@DanH42
DanH42 / windowctl.sh
Created December 20, 2018 16:31
Helper script for performing some useful window manipulation tasks
#!/bin/bash
# Helper script for performing some useful window manipulation tasks
# Version 1.1.2
#
# Dependencies: xdotool
#
# This script should be bound to some keyboard shortcuts, and will target
# whatever window currently has focus. For example:
# Alt+Shift+Left - /path/to/windowctl.sh move_l
@DanH42
DanH42 / gmail-dematerialize.css
Last active June 21, 2020 17:29
Make the new Gmail design look like the old one
/* ==UserStyle==
@name Gmail - Dematerialize
@namespace gist.github.com/DanH42
@version 1.1.7
@description Make the new Gmail design look like the old one
@author Dan Hlavenka
@updateURL https://gist.github.com/DanH42/599cbdc85f53a0377042d8c418aec78e/raw
@preprocessor less
==/UserStyle== */
// ==UserScript==
// @name Facebook Watch is the actual worst
// @namespace com.facebook.watchnt
// @version 1.0.3
// @description Like actually the worst
// @author Dan Hlavenka
// @updateURL https://gist.githubusercontent.com/DanH42/182f4a3b95f2e390aec207135e219b51/raw
// @match https://www.facebook.com/*
// @grant none
// ==/UserScript==
@DanH42
DanH42 / adding-in-javascript.jquery.js
Last active July 7, 2018 05:27 — forked from ceci21/adding-in-javascript.js
let's do math but with jQuery
(function($) {
$.fn.add = function(sep = " = ") {
(function($this) {
const re = /([0-9]+)/g;
const n1 = re.exec($this.text());
const n2 = re.exec($this.text());
if ((n1 && n2) === null) return function(){};
const a = parseInt(n1[0]);
const b = parseInt(n2[0]);
@DanH42
DanH42 / pluma_terminal_here.sh
Created May 25, 2018 19:49
Pluma script to open a terminal to the current document's directory, *including* gvfs locations
#!/bin/bash
OPEN_DIR="$HOME"
if [ ! -z $PLUMA_CURRENT_DOCUMENT_SCHEME ]; then
case $PLUMA_CURRENT_DOCUMENT_SCHEME in
file)
OPEN_DIR="$PLUMA_CURRENT_DOCUMENT_DIR"
;;
smb)
PLUMA_DOC_USER=${PLUMA_CURRENT_DOCUMENT_URI%%@*}
@DanH42
DanH42 / keyboard.user.js
Last active July 16, 2019 20:07
Override keyboard shortcuts in Gmail
// ==UserScript==
// @name Gmail Keyboard Shortcuts
// @namespace com.gmail.keyboard
// @version 1.0.4
// @description Override keyboard shortcuts in Gmail
// @author Dan Hlavenka
// @updateURL https://gist.githubusercontent.com/DanH42/ab83bf856abc7731bec0b0c35bef155d/raw
// @match https://mail.google.com/mail/*
// @grant none
// ==/UserScript==
@DanH42
DanH42 / RoughScroll.user.js
Last active May 24, 2018 21:27
Disables smooth scrolling on ALL websites
// ==UserScript==
// @name RoughScroll
// @namespace net.tampermonkey.roughscroll
// @version 0.2.2
// @description Disables smooth scrolling on ALL websites
// @author Hayden Schiff (oxguy3), Dan Hlavenka
// @updateURL https://gist.githubusercontent.com/DanH42/e3bc5ad5f9db518c6e7727f74a503e02/raw
// @match *://*/*
// @exclude https://www.google.com/maps*
// @grant none
@DanH42
DanH42 / Date.js
Created October 7, 2016 15:22
Lies to other code on the page about the current date/time
Date = function(Date){
var fakeDate = 1475852400000; // Fri Oct 07 2016 10:00:00 GMT-0500 (CDT)
var bind = Function.bind;
var unbind = bind.bind(bind);
function NewDate(){
if(arguments.length === 0)
arguments = [fakeDate];
return new (unbind(Date, null).apply(null, arguments));