Skip to content

Instantly share code, notes, and snippets.

@miku
miku / VectorSearch.py
Created March 27, 2024 11:15 — forked from howard-haowen/VectorSearch.py
Text similarity search using sentence_transformers and faiss
# Reference: kstathou/acl-search-engine
# !pip install faiss-cpu --no-cache
# !pip install sentence_transformers
import faiss
import numpy as np
import pandas as pd
import pickle
import torch
@miku
miku / pipeTee.go
Created December 29, 2016 00:03 — forked from sgmac/pipeTee.go
Example using io.TeeReader and io.Pipe
package main
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"sync"
@miku
miku / llmc.sh
Created February 28, 2024 12:07 — forked from montasaurus/llmc.sh
AI Shell Command Generator
llmc() {
local system_prompt='Output a command that I can run in a ZSH terminal on macOS to accomplish the following task. Try to make the command self-documenting, using the long version of flags where possible. Output the command first enclosed in a "```zsh" codeblock followed by a concise explanation of how it accomplishes it.'
local temp_file=$(mktemp)
local capturing=true
local command_buffer=""
local first_line=true
local cleaned_up=false # Flag to indicate whether cleanup has been run
cleanup() {
# Only run cleanup if it hasn't been done yet
@miku
miku / normcore-llm.md
Created February 20, 2024 17:15 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@miku
miku / slideshow.js
Created January 20, 2011 23:48
Create a simple slideshow that cycles through the images...
<!DOCTYPE html>
<head>
<meta name="found-at" content="http://www.computedstyle.com/2010/12/hiring-front-end-engineers.html">
<meta name="description" content="A div with an id of 'slideshow' contains
five images, the first of which is shown and the others are hidden using a
display style of none. Using Javascript, create a simple slideshow that cycles
through the images, displaying each image for three seconds at a time, looping
back to the first image when the end is reached. You cannot use jQuery or any
other library.">
@miku
miku / Dockerfile
Created January 26, 2024 14:35 — forked from WoozyMasta/Dockerfile
An example of building a Python application into a self-contained statically linked binary and packaging it into a container image based on scratch
FROM docker.io/python:3.9-bullseye AS build
WORKDIR "/app"
# Install dependecies
# hadolint ignore=DL3008,DL3013
RUN set -eux && \
apt-get update; \
apt-get install --no-install-recommends -y \
python3-dev build-essential patchelf upx; \
apt-get clean; \
@miku
miku / .gitignore
Last active December 11, 2023 21:49
Share directory via HTTP, similar to python -m SimpleHTTPServer - webshare
/webshare
@miku
miku / fix.md
Created December 9, 2023 11:26 — forked from kitten/fix.md
Fix "Unknown Chipset" with nouveau

Booting from a Linux installation disk with a newer graphics card might trigger an "Unknown Chipset" error from nouveau.

Add nomodeset nouveau.modeset=0 to the kernel options to fix it.

In UEFI Boot Mode it might also hang at "Triggering uevents", which is the same issue without the error message.

@miku
miku / HowToOTGFast.md
Created September 9, 2023 11:26 — forked from gbaman/HowToOTGFast.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@miku
miku / Sierra.md
Last active August 19, 2023 21:24
MacOS Sierra App Store Link