const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; |
@layer utilities { | |
/* extra helper classes for iphone safe areas */ | |
.safe-p { | |
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); | |
} | |
.safe-px { | |
padding-left: env(safe-area-inset-left); | |
padding-right: env(safe-area-inset-right); | |
} | |
.safe-py { |
My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
/** | |
* @desc It triggers mouse event. | |
* @param {HTMLElement} element target DOM element | |
* @param {string} type type of event | |
* @param {number} x clientX of event | |
* @param {number} y clientY of event | |
*/ | |
export function simulateEvent(element, type, x, y) { | |
const mouseEvent = new MouseEvent(type, { | |
screenX: 0, |
@media not all and (min-resolution:.001dpcm) { | |
@supports (-webkit-appearance:none) { | |
div.something.annoying { | |
line-height: 18px; | |
} | |
} | |
} |
# Create trigger file | |
touch /etc/ssh/sshd_notifier.sh | |
chmod +x /etc/ssh/sshd_notifier.sh | |
vim /etc/ssh/sshd_notifier.sh | |
#!/bin/bash | |
# /etc/ssh/sshd_notifier.sh | |
BOT_TOKEN="xxxxxx:12345678901234567890" | |
CHAT_ID="1234567890" |
function DeepLinker(options) { | |
if (!options) { | |
throw new Error('no options') | |
} | |
var hasFocus = true; | |
var didHide = false; | |
// window is blurred when dialogs are shown | |
function onBlur() { |
Also posted here: http://18pct.com/sending-bash-and-zsh-commands-to-syslog/
Your bash/zsh history is great if its complete, but it doesn't capture commands across all users, sudo's, root commands etc. In particular with test environments, someone may perform a "one-off" procedure and then months later it needs to be repeated. It would be nice to be able to look up what the user did at the time, and searching through multiple, possibly truncated history files is a pain.
Tools like typescript are great if you're actively documenting, but not something you would use all the time in practice and capture more than just a history of your commands. There are third-party tools like rootsh and Snoopy that can accomplish this, but third-party tools can be overkill if all you want is a quick reference in a re