This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// permalink: | |
// https://gist.githubusercontent.com/cemiu/3a0847a2783b1898fc5815db772bf84f/raw/surfingkeys_config.js | |
// /* | |
api.unmapAllExcept([ | |
'i', 'gi', // text box | |
'f', 'gf', // click link (active tab; non-active tab) | |
'e', 'd', 'j', 'k', // navigate page | |
'/', 'n', 'N', 'T', | |
';e', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trap 'export CMD_START_TIME=$(date +%s)' DEBUG | |
precmd() { | |
local exit_code=$? | |
[ -z "$CMD_START_TIME" ] && return | |
local now=$(date +%s) | |
local elapsed=$(printf "%dh%d" $(( (now - CMD_START_TIME) / 3600 )) $(( (now - CMD_START_TIME) % 3600 / 60 ))) | |
local start_time=$(date -d "@${CMD_START_TIME%.*}" +'%Y-%m-%d %H:%M:%S') | |
local cmd=$(HISTTIMEFORMAT= history 1 | sed 's/^ *[0-9]* *//') | |
skips=(ls "ls *" ll "*.bashrc*" exit history "cd *" vim "vim *") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Merge Llama3.2-Instruct template & eos_token into Llama3.2 (pre-trained) | |
""" | |
from transformers import AutoTokenizer, AutoModelForCausalLM | |
model = AutoModelForCausalLM.from_pretrained('meta-llama/Llama-3.2-1B') | |
tok = AutoTokenizer.from_pretrained('meta-llama/Llama-3.2-1B') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
For Sun Grid Engine, print all GPU nodes' utilizations | |
""" | |
import subprocess | |
import xml.etree.ElementTree as ET | |
import pandas as pd | |
import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name GifPause: Pause and Resume annoying GIF Animations on Right Click | |
// @author cemiu | |
// @namespace https://cemiu.net/ | |
// @license MIT | |
// @version 1.4 | |
// @description Pause and resume GIF and WebP animations on right-click | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name SpeedeKey: Control HTML5 Video Speed with a Tap | |
// @author cemiu | |
// @license MIT | |
// @namespace https://cemiu.net/ | |
// @homepage https://gist.github.com/cemiu/db9f64b9d199b75ab218bb7a23b68734 | |
// @homepage https://cemiu.net/ | |
// @version 0.5 | |
// @description Change HTML5 video playback speed right from your keyboard. ("[" to decrease, "]" to increase, Backspace to reset) | |
// @match *://*/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Written by cemiu, distributed under the MIT License | |
# Quick and dirty script to export iMessage conversations as searchable text; Without attatchments or images. | |
# This version supports macOS only, though Windows support should be possible with some light modifications. | |
# Usage: | |
# Create a local, unencrypted (!) backup of an iOS / iPadOS device, through Finder | |
# Open System Settings > Security & Privacy > Privacy > Full Disk Access > Add Terminal.app (Utilities folder) | |
# Download imessage_text_exporter_macos.py file, run Terminal, execute: | |
# python imessage_text_exporter_macos.py |