Skip to content

Instantly share code, notes, and snippets.

@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@RedmiLine
RedmiLine / index.html
Created May 14, 2024 23:28
Privacy Policy
Privacy Policy for Catch Yoo
This Privacy Policy was last updated on 11.10.2023
@bakavets
bakavets / kubernetes-certifications.md
Last active May 14, 2024 23:25
How I passed Kubernetes KCNA, CKAD, CKA, and CKS exams. My experience. Exam tips and tricks.
@Patazerty
Patazerty / hsmghpg.rst
Created July 3, 2023 09:16
Nitrokey HSM 2 GPG setup

Nitrokey HSM GPG setup

I was investigating the use of Hardware Security Modules (HSMs) to better secure some stuff at work. Our choice was a Nitrokey HSM 2 for its convenient price, features and open approach, including hardware. Unfortunately Nitrokeys's documentation is sparse at best and there is not much available documentation online to guide new users to get HSMs to work with GnuPG (GPG): it's even the opposite with some forum posts indicating that the Nitrokey HSM 2 is not compatible with GPG.

From what seems to be the current state of things, GPG works out of the box with OpenPGP cards (which are

@kristopherjohnson
kristopherjohnson / formatjson.js
Last active May 14, 2024 23:13
Read JSON from standard input and writes formatted JSON to standard output. Requires Node.js.
#!/usr/bin/env node
// Reads JSON from stdin and writes equivalent
// nicely-formatted JSON to stdout.
var stdin = process.stdin,
stdout = process.stdout,
inputChunks = [];
stdin.resume();
@ajaegers
ajaegers / js-regex-replace-links-to-markdown
Created June 17, 2014 11:10
Regex Html link to Markdown syntax
@RuizuKun-Dev
RuizuKun-Dev / GistUtil.lua
Created June 7, 2023 08:00
A Module for Interacting with GitHub's Gist API from within Roblox!
local HttpService = game:GetService("HttpService")
local API = "https://api.github.com/gists"
export type JSONString = string
-- Function to encode data into JSON format
-- @param data The data to be encoded
-- @return The encoded data
local function encode(data: table?): JSONString?