Skip to content

Instantly share code, notes, and snippets.

View marty1885's full-sized avatar
πŸ‘¨β€πŸ’»
Writing code

Martin Chang marty1885

πŸ‘¨β€πŸ’»
Writing code
View GitHub Profile
@andrewrcollins
andrewrcollins / trim.awk
Created January 11, 2012 04:22
ltrim(), rtrim(), and trim() in awk
function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
function rtrim(s) { sub(/[ \t\r\n]+$/, "", s); return s }
function trim(s) { return rtrim(ltrim(s)); }
BEGIN {
# whatever
}
{
# whatever
}
END {
@sutlxwhx
sutlxwhx / README.md
Last active February 12, 2025 08:30
Comparison of different popular VPS providers
@Eirenliel
Eirenliel / slimevr-setup.md
Last active July 19, 2022 22:52
SlimeVR Setup instructions
@hanxiao
hanxiao / testRegex.js
Last active April 22, 2025 02:43
Regex for chunking by using all semantic cues
// Updated: Aug. 20, 2024
// Run: node testRegex.js whatever.txt
// Live demo: https://jina.ai/tokenizer
// LICENSE: Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0)
// COPYRIGHT: Jina AI
const fs = require('fs');
const util = require('util');
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 7;
@martinloretzzz
martinloretzzz / tt_eltwise_sfpu.py
Created April 13, 2025 01:56
Tenstorrent eltwise_sfpu in python using cppyy
# This is a python implementation of the eltwise_sfpu example from tt-metal
# Python accesses the C++ API of tt-metalium using cppyy
# C++ source this is based on: https://github.com/tenstorrent/tt-metal/blob/main/tt_metal/programming_examples/eltwise_sfpu/eltwise_sfpu.cpp
# Tutorial: https://docs.tenstorrent.com/tt-metal/latest/tt-metalium/tt_metal/examples/eltwise_sfpu.html
import os
os.environ["TT_METAL_HOME"] = "/root/tt-metal/"
os.environ["ARCH_NAME"] = "wormhole_b0"
import numpy as np