Skip to content

Instantly share code, notes, and snippets.

View blackmiaool's full-sized avatar
🏠
Working from home

blackmiaool blackmiaool

🏠
Working from home
View GitHub Profile
@louisameline
louisameline / windowMouseOutFix.js
Last active July 21, 2023 13:42
Electron: workaround for issue #611
/**
* Work around for https://github.com/electron/electron/issues/611
* This snippet will check if the cursor has left the window, and trigger
* mouse events accordingly. It even works with -webkit-app-region areas,
* which usually don't send any mouse events, so it's pretty cool. You
* can see the result in this gif: http://s214903023.onlinehome.fr/divers/fix.gif
* Help is welcome for improvement, for example to remove the dependency to
* jQuery.
*
* Caveats:it triggers too many events. For example when the mouse
@arielsalminen
arielsalminen / scroll.js
Last active April 18, 2018 09:32
Scrolling
function easeInOutCubic(t, b, c, d) {
if ((t /= d / 2) < 1) {
return c / 2 * t * t * t + b;
}
return c / 2 * ((t -= 2) * t * t + 2) + b;
}
function ButteryScroll(scrollable, distance, duration) {
var startTime;
var startPos = scrollable.scrollTop;
@atenni
atenni / README.md
Last active May 5, 2025 08:06
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]