Skip to content

Instantly share code, notes, and snippets.

View dmstern's full-sized avatar
drinking coffee

Daniel Morgenstern dmstern

drinking coffee
View GitHub Profile
function isVisible(element) {
const style = window.getComputedStyle(element);
return style.display !== 'none';
}
function isFocusable (element) {
const focusableElements = [
'a[href]',
'button:enabled',
'input:enabled',
@dmstern
dmstern / chameleon-scrollbars.css
Last active February 9, 2020 11:06
Make scrollbars dynamically fit to any web design
::-webkit-scrollbar {
width: 11px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background-color: rgba(120, 120, 120, 0.3);
}
::-webkit-scrollbar-thumb:hover {
function createElementFromHTML(htmlString) {
var div = document.createElement('div');
div.innerHTML = htmlString.trim();
return div.firstChild;
}
const markup = `
<span>
<style>
data-testid="reaction_facepalm" {
@dmstern
dmstern / disable hyper-v on windows - admin terminal
Created October 23, 2018 08:57
fix for virtual box not running // disable hyper-v on windows
bcdedit
bcdedit /set hypervisorlaunchtype off
Restart your PC system to use VirtualBox
# Re-enable:
bcdedit /set hypervisorlaunchtype auto
# source: https://discuss.erpnext.com/t/virtualbox-wont-run-raw-mode-unavailable-courtesy-of-hyper-v/34541/10?u=daniel_morgenstern
git log `git describe --tags --abbrev=0`..HEAD --oneline
@dmstern
dmstern / Ignorelist.gitconfig
Last active July 2, 2018 12:22
Git - Temporarily ignore trivial changes to files
# List temporarily ignored files:
[alias]
ignored = !git ls-files -v | grep "^[[:lower:]]"
@dmstern
dmstern / git push
Created May 8, 2018 15:44
How to solve "Git push rejected after feature branch rebase"
git push --force-with-lease
// source: https://stackoverflow.com/a/37460330/1205127
# generated by Git for Windows
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
@dmstern
dmstern / legacy window color setting in Windows 10
Last active July 11, 2018 14:26
legacy window color setting in Windows 10
[WIN] + [R] ->
rundll32.exe shell32.dll,Control_RunDLL desk.cpl,Advanced,@Advanced
# source: https://www.howtogeek.com/222831/how-to-get-colored-window-title-bars-on-windows-10-instead-of-white/
@dmstern
dmstern / .git|config: Git commit template
Last active December 18, 2023 21:03
Git: pre-fill commit message with Jira Issue Id/title and re-use last commit message (also works with VSCode)
# located in .git/config:
# VSCode will use this to prefill the git commit message box.
[commit]
template = .git/.gitmessage.txt