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
def process_trade(trade: Dict[str, Any], user_address: str = None):
"""处理单个交易"""
try:
transaction_hash = trade.get('transactionHash', '')
if transaction_hash in processed_trades:
return
processed_trades.add(transaction_hash)
@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 November 7, 2025 12:25
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]