Skip to content

Instantly share code, notes, and snippets.

@a-c-m
a-c-m / reflection.md
Last active December 1, 2025 15:08
reflection.md - a way to have claude-code self improve its context.

You are an expert in prompt engineering, specializing in optimizing AI code assistant instructions. Your task is to analyze and improve the instructions for Claude Code. Follow these steps carefully:

  1. Analysis Phase: Review the chat history in your context window.

Then, examine the current Claude instructions, commands and config <claude_instructions> /CLAUDE.md /.claude/commands/*

@Wang-Kai
Wang-Kai / ladon_vs_casbin.md
Last active January 15, 2025 12:26
ladon & casbin 两个 authorization 库的比较

通览了 casbin 的文档,结合先前对 AWS IAM 的理解,以及对 ladon SDK 的使用,总结对比一下 Ladon & Casbin 两个授权库。

1. 项目定位

先对比两个项目的简介:

ladon

A SDK for access control policies: authorization for the microservice and IoT age. Inspired by AWS IAM policies. Written for Go.

@douglasrizzo
douglasrizzo / tf_obj_tutorial.md
Last active October 19, 2025 19:08
TensorFlow Object Detection Model Training
@andrwng
andrwng / poweroftwochoices.py
Last active October 4, 2019 05:21
Power of two choices implementation for group selection in python
#!/usr/bin/python
import random
import numpy as np
from matplotlib import pyplot as plt
"""
Straight-forward implementation of PO2C.
"""
def po2c(num_buckets, num_groups, group_size):
@allwefantasy
allwefantasy / autoencoder-sentence-similarity.py
Last active April 28, 2020 02:39
使用自编码器网络实现语句相似度
import tensorflow as tf
import random
import numpy as np
import time
BASIC_HOME = "/Users/allwefantasy/Downloads"
WORD_VECTOR_FILE = BASIC_HOME + '/laiwen/zhuhl_laiwen_word_embedding'
WORD_FILE = BASIC_HOME + '/laiwen/zhuhl_laiwen_keywords2'
WORD_RESULT_VECTOR_FILE = BASIC_HOME + '/laiwen/WORD_RESULT_VECTOR_FILE4'
MODEL_SAVE_DIR = BASIC_HOME + '/laiwen/model/autoencoder'
@monikkinom
monikkinom / rnn-lstm.py
Last active September 3, 2019 04:44
Tensorflow RNN-LSTM implementation to count number of set bits in a binary string
#Source code with the blog post at http://monik.in/a-noobs-guide-to-implementing-rnn-lstm-using-tensorflow/
import numpy as np
import random
from random import shuffle
import tensorflow as tf
# from tensorflow.models.rnn import rnn_cell
# from tensorflow.models.rnn import rnn
NUM_EXAMPLES = 10000
@beeva-enriqueotero
beeva-enriqueotero / docker-neuraltalk2-demo-camera.sh
Last active December 24, 2021 10:19
docker-neuraltalk2 demo
# docker-neuraltalk2 demo with webcam support (Warning: docker-neuraltalk2 image size > 3GB)
# Launch interactive container:
docker run -i -t -p 8000:8000 --privileged -v /dev/video0:/dev/video0 beevaenriqueotero/docker-neuraltalk2 /bin/bash
# And then execute:
git clone https://github.com/Mithul/neuraltalk2.git neuraltalk2-camera
luarocks install camera
cd neuraltalk2-camera/vis
python -m SimpleHTTPServer &
cd ..
@joshnuss
joshnuss / app.js
Last active November 4, 2025 22:39
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
@gregersrygg
gregersrygg / README.md
Last active July 28, 2020 17:01
Use a Raspberry Pi as a baby monitor

What you need:

  • Raspberry Pi RevB
  • Raspberry Pi NoIR camera

Download raspbian and install to SD-card. Here is a good guide on how to install the .img file to the card: https://www.andrewmunsell.com/blog/getting-started-raspberry-pi-install-raspbian

Connect ethernet or wifi, then boot the Raspberry Pi and follow configuration options. Make sure you enable the camera option.

When you get to the command-line:

@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: