Skip to content

Instantly share code, notes, and snippets.

View yeled's full-sized avatar

Charlie Allom yeled

  • London
View GitHub Profile
@yenson-lau
yenson-lau / folderEmails.js
Last active May 26, 2023 03:08
Send all mails in a ProtonMail search query to any folder of your choosing
function waitForElm(selector) {
return new Promise(resolve => {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
}
const observer = new MutationObserver(mutations => {
if ((document.querySelector(selector) !== undefined) &&
(document.querySelector(selector) !== null)) {
resolve(document.querySelector(selector));
> > function blurothers() local dark={{red=0.5, green=0.5, blue=1.0}, {alpha=1.0, red=0.0, green=0.0, blue=0.0}} local light ={{red=1.0, green=1.0, blue=1.0}, {alpha=1.0, red=0.0, green=0.0, blue=0.0}} local main = hs.mouse.getCurrentScreen() for i,v in ipairs(hs.screen.allScreens()) do if v == main then v:setGamma(light[1], light[2]) else v:setGamma(dark[1], dark[2]) end end end
> blurothers()
> blurothers()
> blurothers()
> blurtimer = hs.timer.new(0.1, blurothers)
> blurtimer:start()
@josephholsten
josephholsten / sizeup.lua
Last active June 4, 2022 11:41
SizeUp in Hammerspoon
-- === sizeup ===
--
-- SizeUp emulation for hammerspoon
--
-- To use, you can tweak the key bindings and the margins
local sizeup = { }
--------------
-- Bindings --
@markberly
markberly / portAutoDescription.py
Created February 14, 2014 22:14
Port auto-description tool automatically updates the port description of an interface based on the lldp neighbor information of the attached device. Utilizes Arista EOS eAPI.
#!/usr/bin/python
#
# Copyright (c) 2013, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
@arunoda
arunoda / gist:7790979
Last active September 10, 2024 08:43
Installing SSHPass

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

@nemith
nemith / disable-unconfigured-ifd.slax
Created October 20, 2013 23:35
Junos Commit script to automatically disable all non-defined interfaces.
version 1.0;
ns junos = "http://xml.juniper.net/junos/*/junos";
ns xnm = "http://xml.juniper.net/xnm/1.1/xnm";
ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";
import "../import/junos.xsl";
/* Whitelist of interfaces that are eligble to be automatically disabled. Add
or remove what is needed */
@g-r-a-v-e-l-y
g-r-a-v-e-l-y / gist:5918037
Created July 3, 2013 13:55
iTerm2 -> mosh -> remote xterm-256color with mouse support in tmux, vim, weechat, etc. Hold option to release.
# https://github.com/keithw/mosh/issues/101
# thanks FiXato!
perl -E ' print "\e[?1005h\e[?1002h" '