Skip to content

Instantly share code, notes, and snippets.

View todashuta's full-sized avatar
👋
(  ̄ ♢  ̄ )

todashuta todashuta

👋
(  ̄ ♢  ̄ )
View GitHub Profile
@kyo-takano
kyo-takano / making-the-most-of-local-llms.ipynb
Last active July 21, 2024 05:07
ローカルLLMはこーやって使うの💢
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thesamesam
thesamesam / xz-backdoor.md
Last active July 21, 2024 05:59
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@usagimaru
usagimaru / DumpAllMethods.swift
Last active March 28, 2024 19:52
Get all methods of an class or instance in Swift
// Dump all NSApplication’s class methods
let dump = NSApplication.perform(NSSelectorFromString("fp_methodDescription")).takeUnretainedValue() as? String
// Dump all NSApplication’s instance methods
let dump = NSApp.perform(NSSelectorFromString("fp_methodDescription")).takeUnretainedValue() as? String
// or
print(NSApplication.value(forKey: "fp_methodDescription"))
print(NSApp.value(forKey: "fp_methodDescription"))
@stephancasas
stephancasas / NSApplication+NSResponderDebug.swift
Created March 18, 2024 20:35
An extension on NSApplication providing a computed property that describes the current responder chain.
//
// NSApplication+NSResponderDebug.swift
//
// Created by Stephan Casas on 3/18/24.
//
import Cocoa;
extension NSApplication {
@sheepla
sheepla / README.md
Last active January 21, 2024 08:06
Search duckduckgo with Deno/TypeScript

DenoでHTMLドキュメントをパースする: 雑な解説

DOMの扱い方はよく忘れそうになるので、備忘録がてら書いてみる。MDNから引用するようにしているが、もしかしたら理解が間違っているかもしれない。 DenoでHTMLドキュメントをパースするには、deno-dom-wasmを使う。

deno-dom-wasmはDenoのためのDOMおよびHTML parserの実装。Rust (WASMコンパイル)とTypeScriptで書かれている。

parseFromStringメソッドを使ってHTMLドキュメントをパースする。

@niw
niw / test.py
Last active August 27, 2023 13:26
Use CodeLlama on macOS with MPS quickly
# Usage
# =====
#
# ## Prerequisite
#
# Prepare Python 3, for exmaple, install Homebrew and `brew install python`.
#
# ## Install dependencies
#
# $ python3 -m venv .venv
@kyo-takano
kyo-takano / lexical_search_with_gzip.py
Last active March 11, 2024 03:39
Lexical Search with gzip (gzipによる語彙検索)
import gzip
def gzip_search(query: str, candidate_chunks: list[str], top_k: int=1):
"""
文字列ベースで類似したテキストチャンクを推定するアルゴリズム.
`query`, `chunk`, および`query + " " + chunk`をそれぞれgzipで圧縮し編集距離のようなものをベースに評価する.
Parameters:
query (str): 検索クエリとして使用する文字列.
top_k (int, optional): 返される類似チャンクの上位k個を指定する (default: 1).
@woxtu
woxtu / ocr.js
Last active May 3, 2024 04:45 — forked from doraTeX/ocr.sh
A JavaScript (JXA) to perform OCR on images/PDFs using macOS built-in OCR engine
#!/usr/bin/osascript -l JavaScript
ObjC.import("stdlib");
ObjC.import("AppKit");
ObjC.import("PDFKit");
ObjC.import("Vision");
const scriptName = $.NSProcessInfo.processInfo.arguments.objectAtIndex(3).lastPathComponent.js;
console.error = (obj) => {
@voluntas
voluntas / learning-webrtc_2023-05.md
Last active March 16, 2024 15:30
時雨堂 WebRTC 入門 (講師資料) v2023-05

時雨堂 WebRTC 入門 (講師資料) v2023-05

これは時雨堂が開催しているオンラインイベントである WebRTC 入門の 講師用 の資料であり、 参加者用の資料ではありません。

時雨堂 WebRTC 入門 オンラインイベント

概要

ChatGPT がある今、学ぼうと思えば好きなだけ学べる時代がきています。

@echo off
set KEY=HKEY_CURRENT_USER\SOFTWARE\VRChat\VRChat
reg query %KEY% /f "FriendsPerLocation*" > VRChat_FriendsPerLocation_raw.txt
find "FriendsPerLocation" < VRChat_FriendsPerLocation_raw.txt > VRChat_FriendsPerLocation_filtered.txt
del VRChat_FriendsPerLocation_raw.txt
for /f %%t in (VRChat_FriendsPerLocation_filtered.txt) do (
reg delete %KEY% /v "%%t" /f
)
del VRChat_FriendsPerLocation_filtered.txt