start new:
tmux
start new with session name:
tmux new -s myname
| class Person (db.Document): | |
| name = db.StringField(required=True) | |
| created_date = db.ComplexDateTimeField(default=datetime.datetime.utcnow(), required=True) | |
| def to_dict(self): | |
| return helper.mongo_to_dict(self,[]) | |
| #helper.py | |
| def mongo_to_dict(obj, exclude_fields): |
| # (C) Mathieu Blondel, November 2013 | |
| # License: BSD 3 clause | |
| import numpy as np | |
| def ranking_precision_score(y_true, y_score, k=10): | |
| """Precision at rank k | |
| Parameters |
Cython has two major benefits:
Cython gains most of it's benefit from statically typing arguments. However, statically typing is not required, in fact, regular python code is valid cython (but don't expect much of a speed up). By incrementally adding more type information, the code can speed up by several factors. This gist just provides a very basic usage of cython.
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| calculate a weighted median | |
| @author Jack Peterson (jack@tinybike.net) | |
| """ | |
| from __future__ import division | |
| import numpy as np | |
| def weighted_median(data, weights): |
There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.
All other files should be in your own global gitignore file:
.gitignore in your home directory and add any filepath patterns you want to ignore.Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute
.config/git/ignorefor.gitignorein your home directory, if you prefer.
| #include <cstddef> /* NULL */ | |
| #include <metis.h> | |
| #include <iostream> | |
| // Install metis from: | |
| // http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz | |
| // Build with | |
| // g++ metis.cc -lmetis |
| ;; make sure you've set your default project with: | |
| ;; gcloud config set project <project-name> | |
| (require 'tramp) | |
| (add-to-list 'tramp-methods | |
| '("gcssh" | |
| (tramp-login-program "gcloud compute ssh") | |
| (tramp-login-args (("%h"))) | |
| (tramp-async-args (("-q"))) | |
| (tramp-remote-shell "/bin/sh") |
A pattern for building personal knowledge bases using LLMs.
This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.
Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.