Skip to content

Instantly share code, notes, and snippets.

@hanool
hanool / notification.ts
Created March 18, 2026 04:36
opencode simple terminal notification
// ~/.config/opencode/plugins/notification.ts
import type { Plugin } from '@opencode-ai/plugin'
export const NotificationPlugin: Plugin = async ({ project, client, $ }) => {
const notify = async () => {
await $`printf '\a'`
}
return {
event: async ({ event }) => {
@hanool
hanool / Dockerfile
Last active February 19, 2026 04:59 — forked from synthic/Dockerfile
DSpico Firmware Builder
FROM skylyrac/blocksds:slim-latest
RUN apt update && apt install -y \
build-essential \
cmake \
gcc-arm-none-eabi \
git \
python3
ENV DLDITOOL=/opt/wonderful/thirdparty/blocksds/core/tools/dlditool/dlditool
@hanool
hanool / microgpt.py
Created February 17, 2026 04:25 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
/**
* @param {number[]} nums ascending sorted array of int
* @return {number[]}
*/
var sortedSquares = function (nums) {
var squaredNums = nums.map(function (val) {
return val * val;
});
var leftToRight = 0;