This file contains 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
func h2b(pair) { s="0123456789abcdef"; return index(s, tolower(substr(pair,1,1)))*16+index(s, tolower(substr(pair,2,1)))-17; } | |
func h2d_le(str) { x=0; for(i=length(str)-2;i>=0;i-=2) { x=x*256+h2b(substr(str,i+1,2)) } return x } | |
func h2d_be(str) { x=0; for(i=0;i<length(str);i+=2) { x=x*256+h2b(substr(str,i+1,2)) } return x } | |
func h2z(str) { x=""; for(i=0;i<length(str);i+=2) { v=h2b(substr(str,i+1,2)); if(v==0) { break } x=x sprintf("%c", v); }; return x} | |
func h2bs(str) { x=""; for(i=0;i<length(str);i+=2) { v=h2b(substr(str,i+1,2)); x=x sprintf("%c", v); }; return x} | |
BEGIN { | |
EXCLUDED_PACKAGES["gpg-pubkey"]=0 | |
if(!cols) { | |
cols=108 |
This file contains 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
/* ==UserStyle== | |
@name PTT Image Resize | |
@version 0.0.1 | |
@author Nightfeather | |
*/ | |
@-moz-document domain("www.ptt.cc") { | |
.richcontent { | |
display: flex; | |
justify-content: center; | |
align-items: center; |
This file contains 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 Hololive FC Player Firefox Stub | |
// @namespace Violentmonkey Scripts | |
// @match https://hololive-fc.com/video/* | |
// @grant none | |
// @version 1.0 | |
// @author Nightfeather | |
// @description 8/6/2023, 1:42:37 PM | |
// ==/UserScript== |
This file contains 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 PTT 還原內嵌圖 | |
// @namespace Violentmonkey Scripts | |
// @match https://www.ptt.cc/bbs/* | |
// @grant none | |
// @version 1.0 | |
// @author Nightfeather | |
// @description 8/6/2023, 11:13:01 AM | |
// ==/UserScript== |
This file contains 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
[Desktop Entry] | |
Name=UMR GUI | |
Comment=User Mode Register GUI for AMDGPU | |
Exec=/usr/local/bin/umrdesktop.sh | |
Terminal=false | |
Type=Application |
This file contains 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
class MMapEntry | |
attr_reader :addr_range, :permission, :offset, :devnum, :inode, :path | |
def self.from_procmaps line | |
addr, perm, offset, devnum, inode, path = line.split | |
saddr, eaddr = addr.split("-").map { |a| a.to_i 16 } | |
dev = devnum.split(":").map { |s| s.to_i 16 } | |
path = path[1..-2].to_sym if path =~ /\[.+\]/ | |
MMapEntry.new saddr..eaddr, perm, offset.to_i(16), dev, inode, path | |
end |
This file contains 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
from RPi import GPIO | |
import time | |
mid = 440/(2**(10/12)) | |
notes = dict(zip("C C# D D# E F F# G G# A A# B".split(), [mid*2**(i/12) for i in range(12)])) | |
speed = 60/114 | |
scores = [ | |
(-1, "A", 1/4), | |
(-1, "B", 1/4), |
This file contains 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 ruby | |
require "time" | |
require "optparse" | |
require "optparse/time" | |
class Package | |
@@list = {} |
This file contains 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 ruby | |
require "stringio" | |
require "tempfile" | |
require "sqlite3" | |
module StringConvert | |
refine String do | |
def btol endianess = :BE |
This file contains 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
#!/bin/bash | |
function retry() { | |
if [[ $# -lt 3 ]]; then | |
return 1 | |
fi | |
limit=$1 | |
shift | |
timeout=$1 |
NewerOlder