Skip to content

Instantly share code, notes, and snippets.

@MortalHappiness
MortalHappiness / graphrag_monkey_patch.py
Last active July 22, 2025 06:32
Monkey-patching the https://github.com/microsoft/graphrag package to make it support the locally hosted LLM models on Ollama. See https://chishengliu.com/posts/graphrag-local-ollama/ for details.
# Monkey patch the graphrag package to support local models deployed via Ollama. Only tested for graphrag version 0.3.2.
# See https://chishengliu.com/posts/graphrag-local-ollama/ for details.
#
# Usage:
# * How to patch the `graphrag.index` CLI:
# * Save https://github.com/microsoft/graphrag/blob/v0.3.2/graphrag/index/__main__.py as "index.py"
# * Replace line 8 with:
# ```python
# from graphrag.index.cli import index_cli
# from graphrag_monkey_patch import patch_graphrag
@TommyJSWu
TommyJSWu / ct_queen.cpp
Last active June 27, 2022 01:47
Compile-time solving 8-Queens Problem
#include <iostream>
#include <array>
#include <type_traits>
#include <iterator>
template<int... ns>
struct mylist
{
constexpr static std::array<int, sizeof...(ns)> value{ns...};
};
@cmod
cmod / hugofastsearch.md
Last active September 13, 2025 07:29 — forked from eddiewebb/readme.md
Fast, instant client side search for Hugo static site generator
@lisez
lisez / hugo-auto-deoply.yml
Last active October 10, 2024 11:41
如何使用 Github Actions 自動部署 Hugo
# link: https://sujingjhong.com/posts/how-to-deploy-hugo-automatically-with-github-actions/
# author: lisez <mm4324@gmail.com>
name: Auto publish to public site
# 只有推送到 master 才自動化
on:
push:
branches:
- master
package main
import (
"encoding/json"
"testing"
)
type foo struct {
ID string `json:"_id"`
Index int `json:"index"`
@ckhung
ckhung / airtw-scraper.js
Last active December 9, 2020 23:59
puppeteer 簡單互動範例: 下載環保署空氣品質監測網資料
#!/usr/bin/env node
// http://toddhayton.com/2018/08/01/scraping-with-puppeteer/
// airtw-scraper.js https://www.cwb.gov.tw/V7/observe/real/46757.htm > a.htm
const homedir = require('os').homedir();
const puppeteer = require(homedir + '/node_modules/puppeteer');
const url = 'https://airtw.epa.gov.tw/';
async function main() {
const browser = await puppeteer.launch();
@fnky
fnky / ANSI.md
Last active October 18, 2025 10:22
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@nadavrot
nadavrot / Matrix.md
Last active October 16, 2025 09:22
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@eddiewebb
eddiewebb / readme.md
Last active August 7, 2025 09:16
Hugo JS Searching with Fuse.js
@asukakenji
asukakenji / 0-go-os-arch.md
Last active August 5, 2025 19:35
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android