Skip to content

Instantly share code, notes, and snippets.

View ljm625's full-sized avatar
🎯
Focusing

Jiaming Li ljm625

🎯
Focusing
View GitHub Profile
@cfillion
cfillion / ja_JP.UTF-8.md
Last active February 26, 2024 14:09
Solution for locale and character encoding issues in Japanese games on Steam Deck

Problem 1

Cannot access filenames containing non-ASCII characters.

Steam Deck's SteamOS 3 provides only one locale named en_US.utf8 (as configured in /etc/locale.gen) but /etc/locale.conf sets LANG to en_US.UTF-8. They don't match, so the effective locale for programs is C and the character set becomes limited to ASCII.

Set the game's launch options in Steam to LANG=en_US.utf8 %command% to solve this.

To fix this for all applications running in desktop mode (eg. to correctly extract games), create a file named ~/.config/plasma-workspace/env/utf8.sh containing (restart desktop mode to apply):

@jin10086
jin10086 / Controller.sol
Created August 4, 2020 02:34
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.17+commit.d19bba13.js&optimize=true&gist=
/**
*Submitted for verification at Etherscan.io on 2020-07-26
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.16;
interface IERC20 {
function totalSupply() external view returns (uint256);
@amcolash
amcolash / flowkey.js
Last active August 7, 2023 14:50
UPDATE, see here: https://github.com/amcolash/flowkey-scraper - Noteflight auto transcribe
// Find the sheet music images on the page
const elements = document.getElementsByClassName('split-image');
// Check that there are actually images on the page
if (elements.length === 0) {
console.error('No images found');
} else {
// If images were found, extract the base url from the 1st one
const imageUrl = elements[0].src;
const imageIdMatch = /\/sheets\/([\w\d]+)\//;
@YihaoPeng
YihaoPeng / Stratum挖矿协议.md
Last active July 26, 2023 14:07
Stratum挖矿协议

Stratum挖矿协议: 该协议是由SlushPool制定的,请参阅其官方文档:https://slushpool.com/help/manual/stratum-protocol

以下所有报文均使用\n做为行结束符。


矿机订阅:

{"id": 1, "method": "mining.subscribe", "params": []}
# If you're looking into the C10M problem (10 million concurrent connections)
# you might want to play with DPDK (Originally proprietry Intel, now open source)
#
# C10M: http://c10m.robertgraham.com/
# DPDK: http://dpdk.org/
#
# This is a quick summary how to install dpdk on ubuntu
# running inside virtualbox on a mac
# On my Mac: