most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat| ''' | |
| given a Model with: | |
| category = models.CharField(max_length=32, choices=CATEGORY_CHOICES) | |
| pubdate = models.DateTimeField(default=datetime.now) | |
| <other fields> | |
| Fetch the item from each category with the latest pubdate. | |
| ''' |
GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.
| #!/usr/bin/env python | |
| """ | |
| Real time log files watcher supporting log rotation. | |
| Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com> | |
| License: MIT | |
| """ | |
| import os |
| import numpy as np | |
| from matplotlib import pylab as plt | |
| #from mpltools import style # uncomment for prettier plots | |
| #style.use(['ggplot']) | |
| # generate all bernoulli rewards ahead of time | |
| def generate_bernoulli_bandit_data(num_samples,K): | |
| CTRs_that_generated_data = np.tile(np.random.rand(K),(num_samples,1)) | |
| true_rewards = np.random.rand(num_samples,K) < CTRs_that_generated_data | |
| return true_rewards,CTRs_that_generated_data |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
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.