Skip to content

Instantly share code, notes, and snippets.

View MrAMS's full-sized avatar
😀
Creating!

Kika MrAMS

😀
Creating!
View GitHub Profile
@MrAMS
MrAMS / get_am_key.c
Created March 11, 2024 12:29
ysyx - PS/2扫描码翻译成AM定义的键盘码
int get_am_key(int code){
switch (code) {
case 0x76: return AM_KEY_ESCAPE;
case 0x05: return AM_KEY_F1;
case 0x06: return AM_KEY_F2;
case 0x04: return AM_KEY_F3;
case 0x0C: return AM_KEY_F4;
case 0x03: return AM_KEY_F5;
case 0x0B: return AM_KEY_F6;
case 0x83: return AM_KEY_F7;
#!/bin/bash
if [ -z "$2" ]; then
echo "Usage: <dir_name> <url>"
echo " <url> support printf format and continue to download until fail"
exit 1
fi
mkdir "$1"
cd "$1"
@MrAMS
MrAMS / gist:575a3b3ea1cfba1545105e582db3faf6
Last active February 11, 2019 04:57
完美解决Bootstrap4 导航栏 fixed-top 后,锚点定位时遮挡问题

利用锚点改变事件onhashchange详见使用jQuery的scrollTop向前滚回导航栏的高度(比如我的100个像素) HTML:

<body onhashchange="fix_the_nav();">
</body>

js:

function fix_the_nav() {
 if(window.location.hash){