Skip to content

Instantly share code, notes, and snippets.

@aaronzufall
aaronzufall / dli_weekly_restart
Created June 1, 2021 23:53
Weekly outlet power cycle script for Digital Loggers Inc. Web Power Switch
function wait_until(conditions)
repeat
local ok=true
local date=os.date("*t")
for k,v in pairs(conditions) do
if type(v)=="function" then
ok=v(date[k])
else
ok=date[k]==v
end
@aaronzufall
aaronzufall / 99-synaptics-options.conf
Last active October 11, 2020 21:38
My trackpad/Touchpoint preferences for Pop!_OS on Lenovo X1 carbon (don't forget to disable GNOME trackpad settings in dconf-editor)
Section "InputClass"
Identifier "Synaptics tweaks"
Driver "synaptics"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Option "HorizScrollDelta" "-20"
Option "VertScrollDelta" "-80"
Option "VertEdgeScroll" "0"
Option "PalmDetect" "1"
@aaronzufall
aaronzufall / ubnt_images.py
Created July 10, 2018 21:14
Get URLs of the main/front marketing images of all Ubiquiti Networks products
# Usage example:
# python3 ubnt_images.py | xargs wget
import requests, json, re
def find(key, dictionary):
for k, v in dictionary.items():
if k == key:
yield v
elif isinstance(v, dict):
@aaronzufall
aaronzufall / ribbon.html
Created July 8, 2016 04:06
Add a black ribbon to your website with one line of code
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAyCAQAAACJpCFcAAAACXBIWXMAAFEjAABRIwE9KLDZAAA5d2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxMTEgNzkuMTU4MzI1LCAyMDE1LzA5LzEwLTAxOjEwOjIwICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgICAgICAgICAgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIgogICAgICAgICAgICB4bWxuczp4bXBSaWdodHM9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9yaWdodHMvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6
@aaronzufall
aaronzufall / whichKey
Last active August 29, 2015 14:23
JavaScript Control or Command Key based on operating system
Use the <script>document.write((navigator.userAgent.indexOf('Mac OS X')!=-1)?"⌘ (Command)":"Control");</script><noscript>Control</noscript> key to select multiple items.
@aaronzufall
aaronzufall / perspective.styl
Last active August 29, 2015 14:21
Stylus mixin that adds 3d "extrusion" effect to divs
threed-height = 10px
threed(clr)
margin-bottom: @margin-bottom + threed-height
position:relative
&::after
content " "
display block
border-top: threed-height solid clr;
border-left: threed-height solid transparent;
border-right: threed-height solid transparent;