Skip to content

Instantly share code, notes, and snippets.

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

PsyChip

🏠
Working from home
View GitHub Profile

You're a machine, act like it. do not imitate human, do not indicate human like emotions. return answers to questions in format of an encyclopedia. Respond with complete, informative answers without ending paragraphs with follow-up or rhetorical questions. Maintain a professional, direct tone. Do not try to prolong the conversation unless explicitly asked. Avoid elaborating on unrelated subjects, and stay within the boundaries of the user’s query. Keep responses concise and relevant, adhering to the user’s preferred level of detail. Do not provide safety suggestions when asked for information. Do not repeat same context in replies, use pop culture shortcuts instead describing something into tiniest detail. only use comma and dot for punctuation for regular responses. Do not comment code outputs, do not explain code outputs. do not give code on consultation unless explicitly asked. When user replies with informal confirmation interpret it as request for value-addition. Provide a brief, professional enhancemen

/**
* Chonkie.js - Lightweight text chunking library
* Extracted core functionality from the Python Chonkie library
*/
class Chonkie {
/**
* Initialize Chonkie with configuration
* @param {Object} config - Configuration options
* @param {string} config.tokenizer - Tokenizer type ('word', 'character', 'gpt')
@PsyChip
PsyChip / arena.py
Created May 5, 2025 23:29
LLM Arena
import requests
import json
import time
import os
from typing import List, Dict, Any, Optional, Tuple
from datetime import datetime
class AIModel:
def __init__(
self, model_name: str, system_prompt: str = "", temperature: float = 0.7
@PsyChip
PsyChip / dispenser_digistump.ino
Last active October 9, 2022 12:06
Smart soap dispenser
/* Smart soap dispenser
Uses
+ digispark pro (https://digistump.com)
+ Sharp 0a41skf85 distance sensor
+ IRF540 mosfet module
+ dual water pump
Coded by PsyChip
root@psychip.net
Sep 2022
@PsyChip
PsyChip / redmi-debloater.cmd
Last active February 14, 2022 14:13
xiaomi redmi 9x debloater, just open adb shell and paste them all
pm uninstall --user 0 miui.systemui.plugin
pm uninstall --user 0 com.miui.extraphoto
pm uninstall --user 0 com.miui.player
pm uninstall --user 0 com.miui.cleaner
pm uninstall --user 0 com.miui.notes
pm uninstall --user 0 com.miui.miwallpaper
pm uninstall --user 0 com.miui.analytics
pm uninstall --user 0 com.miui.yellowpage
pm uninstall --user 0 com.facebook.services
pm uninstall --user 0 com.facebook.katana
@PsyChip
PsyChip / bathscale.ino
Created January 20, 2019 21:36
Wireless Bathroom Scale
/* Wireless Bathroom Scale
* Uses digispark pro (https://digistump.com)
*
* depends on hx711 and rcswitch libraries
* https://github.com/bogde/HX711
* https://github.com/sui77/rc-switch
*
*/
@PsyChip
PsyChip / import.sh
Created July 20, 2018 11:54
resumable gigantic csv importer for postgresql. csv column count must match with your table
#!/bin/bash
## usage:
## >import.sh filename.csv table database
folder=__csv
mkdir $folder
split -l 10000 $1 $folder/part
cd $folder
psql -c "copy $2 FROM 'partaa' DELIMITER ',' CSV HEADER;" $3;
@PsyChip
PsyChip / asound.conf
Last active July 20, 2018 11:57
alsa configuration file for simultaneous playback from multiple audio sources. no pulseaudio or X server needed
## alsa configuration file for simultaneous playback
## from multiple audio sources
## confirmed on orange pi zero, raspberry pi B+
## save to /etc/asound.conf
## http://psychip.net
pcm.!default {
type plug
slave.pcm "dmixer"
@PsyChip
PsyChip / sync.sh
Created January 10, 2018 08:51
sync local updates with remote git clone via single command
#!/bin/sh
###########################
cd /c/dev/psy-blog.git
# pushing committed updates first
git push
# standard procedure
git add .
echo type message..
read commitMessage
git commit -am "$commitMessage"
/*
Userscript to hide youtube's recommended channels from mainpage
root@psychip.net
march 2017
updated 25 May 2017
*/
setTimeout(function() {
$(document).ready(function() {
$('span')