Skip to content

Instantly share code, notes, and snippets.

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

XieJiSS XieJiSS

🏠
Working from home
View GitHub Profile
@XieJiSS
XieJiSS / index.html
Last active August 16, 2023 09:09
MWE: Electron's Protocol Interceptor Likes Eating Cookies. Requires `set-cookie-parser`
<html>
<head>
<script>
window.location.replace("https://dash.cloudflare.com/")
</script>
</head>
<body></body>
</html>
@XieJiSS
XieJiSS / userscript.js
Last active May 9, 2024 06:48
CC98 remove watermark tampermonkey userscript
// ==UserScript==
// @name No Watermark CC98
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Remove CC98 watermark
// @author who cares?
// @license WTFPL
// @run-at document-start
// @match https://www.cc98.org/*
// @icon https://www.cc98.org/static/98icon.ico
#include <stdio.h>
#include <stdint.h>
#include <sys/time.h>
#include <time.h>
#include <inttypes.h>
static inline uint64_t toku_time_now(void) {
#if defined(__x86_64__) || defined(__i386__)
uint32_t lo, hi;
__asm__ __volatile__("rdtsc" : "=a"(lo), "=d"(hi));
@XieJiSS
XieJiSS / emoji-strip-browser.js
Last active February 27, 2023 21:40
To strip all emoji(s) from texts.
// generated with emoji-strip-node.js
// ref https://unicode.org/Public/emoji/12.1/emoji-data.txt
const emojiRegex = /©|®|‼|⁉|™|ℹ|[↔-↙]|↩|↪|⌚|⌛|⌨|⏏|[⏩-⏳]|[⏸-⏺]|Ⓜ|▪|▫|▶|◀|[◻-◾]|[☀-☄]|☎|☑|☔|☕|☘|☝|☠|☢|☣|☦|☪|☮|☯|[☸-☺]|♀|♂|[♈-♓]|♟|♠|♣|♥|♦|♨|♻|♾|♿|[⚒-⚔]|⚕|⚖|⚗|⚙|⚛|⚜|⚠|⚡|⚪|⚫|⚰|⚱|⚽|⚾|⛄|⛅|⛈|⛎|⛏|⛑|⛓|⛔|⛩|⛪|[⛰-⛵]|[⛷-⛺]|⛽|✂|✅|[✈-✍]|✏|✒|✔|✖|✝|✡|✨|✳|✴|❄|❇|❌|❎|[❓-❕]|❗|❣|❤|[➕-➗]|➡|➰|➿|⤴|⤵|[⬅-⬇]|⬛|⬜|⭐|⭕|〰|〽|㊗|㊙|\u{1F004}|\u{1F0CF}|\u{1F170}|\u{1F171}|\u{1F17E}|\u{1F17F}|\u{1F18E}|[\u{1F191}-\u{1F19A}]|[\u{1F1E6}-\u{1F1FF}]|\u{1F201}|\u{1F202}|\u{1F21A}|\u{1F22F}|[\u{1F232}-\u{1F23A}]|\u{1F250}|\u{1F251}|[\u{1F300}-\u{1F321}]|[\u{1F324}-\u{1F393}]|\u{1F396}|\u{1F397}|[\u{1F399}-\u{1F39B}]|[\u{1F39E}-\u{1F3F0}]|[\u{1F3F3}-\u{1F3F5}]|[\u{1F3F7}-\u{1F4FD}]|[\u{1F4FF}-\u{1F53D}]|[\u{1F549}-\u{1F54E}]|[\u{1F550}-\u{1F567}]|\u{1F56F}|\u{1F570}|[\u{1F573}-\u{1F579}]|\u{1F57A}|\u{1F587}|[\u{1F58A}-\u{1F58D}]|\u{1F590}|\u{1F595}|\u{1F596}|\u{1F5A4}|\u{1F5A5}|\u{1F5A8}|\u{1F5B1}|\u{1F5B2}|\u{1F5BC}|[\u{1F5C2}-\u{1F5C4}]|[\u{1F5D1}-\u{1F5D
[Unit]
Description = AWTRIX Service
After network.target = awtrix.service
[Service]
Type = forking
WorkingDirectory = /usr/local/awtrix
ExecStart = /usr/local/bin/awtrix.sh start
ExecStop = /usr/local/bin/awtrix.sh stop
ExecReload = /usr/local/bin/awtrix.sh reload
cdfinder () {
target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'`
if [ "$target" != "" ]
then
cd "$target"
pwd
else
echo 'No Finder window found' >&2
fi
}
/* from: https://gist.github.com/bartaz/1119041 */
/* bug fixed, as mentioned in comments of the link above */
function toIEEE754DoubleString(v) {
return toIEEE754Double(v)
.map(function (n) {
for(n = n.toString(2); n.length < 8; n="0"+n);
return n;
})
.join('')