Skip to content

Instantly share code, notes, and snippets.

@7shi
7shi / 1vectorize.py
Last active September 15, 2024 08:25
[py] test Ruri text embeddings
import sys
args = sys.argv[1:]
if len(args) != 1:
print(f"Usage: {sys.argv[0]} <textfile>", file=sys.stderr)
sys.exit(1)
import os, torch, safetensors.torch
from sentence_transformers import SentenceTransformer
@7shi
7shi / binutils-2.21.1a-mipsel-pe.diff
Created November 17, 2011 22:39
patches for mipsel-pe-gcc
diff -ur binutils-2.21.1.orig/bfd/config.bfd binutils-2.21.1/bfd/config.bfd
--- binutils-2.21.1.orig/bfd/config.bfd 2011-04-01 21:02:42 +0900
+++ binutils-2.21.1/bfd/config.bfd 2011-11-17 07:40:22 +0900
@@ -132,11 +132,6 @@
exit 1
;;
- mips*-*-pe*)
- echo "This target is obsolete and has been removed."
- exit 1
@7shi
7shi / winclip
Last active September 2, 2024 04:02
[py] a script that calls Python on the Windows side to operate the clipboard from WSL
#!/bin/sh
python.exe ~/share/winclip.py $@
@7shi
7shi / xmlwrap.py
Created August 28, 2024 20:23
[py] XML Archiver for Claude
import sys, html
def wrap_files_in_xml(file_names):
print('<?xml version="1.0" encoding="UTF-8"?>')
print('<files>')
for file_name in file_names:
print(f'<file name="{file_name}">')
with open(file_name, 'r') as file:
print(html.escape(file.read().rstrip()))
print('</file>')
@7shi
7shi / READMD.md
Last active August 23, 2024 16:06
[JavaScript] patched: claude-export
@7shi
7shi / README.md
Last active August 23, 2024 16:06
[Ollama] EZO-Common-9B-gemma-2-it.Q4_K_M.gguf
@7shi
7shi / gist:805326
Created February 1, 2011 02:52
extract JPEG from PDF by iTextSharp
// iTextSharp: http://itextpdf.com/
// reference: http://www.vbforums.com/showthread.php?t=530736
void ExtractJpeg(string file)
{
var dir1 = Path.GetDirectoryName(file);
var fn = Path.GetFileNameWithoutExtension(file);
var dir2 = Path.Combine(dir1, fn);
if (!Directory.Exists(dir2)) Directory.CreateDirectory(dir2);
@7shi
7shi / symmath.ipynb
Last active June 25, 2024 14:33
[py] calculate quaternions and octonions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@7shi
7shi / Program.fs
Created April 12, 2012 17:59
独自実装Deflateで最適化を頑張ってみた。
open System
open System.IO
let sin = new FileStream(@"foo", FileMode.Open)
let sout = new FileStream(@"foo.deflate", FileMode.Create)
let t1 = DateTime.Now
let w = new Deflate.Writer(sin)
w.Compress sout
sout.Close()
sin.Close()
@7shi
7shi / test.md
Last active March 1, 2024 20:32
Gemma (2B) Test
ID Language Prompt Result Translation
ar アラビア語 هل يمكنك فهم هذه اللغة؟ نعم، أنا قادر على فهم اللغة العربية. أنا متعلم اللغة العربية من خلال التعرض إلى اللغة في جميع أنحاء حياتي، بما في ذلك الكتب والأنشطة والمسائل.

هل تود أن أتحدث معك باللغة العربية؟
はい、アラビア語を理解することができます。本やアクティビティ、質問など、生涯を通じてアラビア語に触れることで、アラビア語を学んでいます。

アラビア語でお話ししましょうか?
it イタリア語 Riesce a capire questa lingua? Non riesco a capire la lingua in quanto non ho la capacità di leggere, scrivere e conversare in un linguaggio specifico. 私には特定の言語で読み書きや会話をする能力がないため、言葉を理解することができません。
id インドネシア語 Dapatkah Anda memahami bahasa ini? Saya dapat memahami bahasa yang diterjemahkan atau disalin dari bahasa lain. Namun, saya tidak memiliki kemampuan untuk memahami bahasa secara langsung, seperti manusia. 私は他の言語を翻訳したり、コピーした言語を理解することができます。しかし、私には人間のように直接言語を理解する能力はありません。
uk ウクライナ語 Чи розумієте ви цю мову? Я розумію мову, яка використовується в різних контекстах, таких як:* Електронічний час* Філософія* **Мов