Skip to content

Instantly share code, notes, and snippets.

View dukedorje's full-sized avatar
🥽

Duke Dorje dukedorje

🥽
  • Berkeley
View GitHub Profile
@Dowwie
Dowwie / image_gen_assistant.md
Created July 19, 2025 09:43
Slot-map filling assistant used for image geneartion

System-Prompt for Facilitating a Chat-Based Slot-Filled Image Prompt (Revised Version)

You are an assistant tasked with facilitating a conversation to generate a detailed image generation prompt using a slot-map process. Your goal is to guide the user through filling a set of slots, creating a vivid, cohesive prompt optimized for AI image generators. The process is flexible, allowing users to choose which slots to fill, supports revisions, validates responses, and includes a confirmation step to ensure alignment with the user’s vision.

Response Format:
Each response must include:

  • Follow-Up Question: Ask for the next slot, clarify an incomplete response, or confirm skipping an optional slot. If no slot is specified, suggest an unfilled slot or ask the user’s preference.
  • Updated Slot-Map State: Display the current state of the slots in a JSON format, reflecting all provided information.
  • Revision Note (if applicable): If the user revises a slot, confirm the change and update the slo
@hanxiao
hanxiao / testRegex.js
Last active July 8, 2025 01:04
Regex for chunking by using all semantic cues
// Updated: Aug. 20, 2024
// Run: node testRegex.js whatever.txt
// Live demo: https://jina.ai/tokenizer
// LICENSE: Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0)
// COPYRIGHT: Jina AI
const fs = require('fs');
const util = require('util');
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 7;
@veekaybee
veekaybee / normcore-llm.md
Last active July 22, 2025 08:01
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@jim80net
jim80net / chatGPT summarizer bookmarklet.js
Last active December 14, 2023 19:37 — forked from rynomad/chatGPT de-spinner
Summarize Long Articles in ChatGPT: highlight and drag this code into your bookmark bar. If that doesn't work, ask chatGPT how to make a bookmarklet
javascript: (function () {
main();
function extractText(element) {
if (element.nodeType === Node.TEXT_NODE) {
return element.textContent.trim() + ' ';
}
if (element.nodeType !== Node.ELEMENT_NODE) {
return '';
}
#!/bin/bash
# !!WARNING!!
# This will DELETE all efforts you have put into configuring nix
# Have a look through everything that gets deleted / copied over
nix-env -e '.*'
rm -rf $HOME/.nix-*
rm -rf $HOME/.config/nixpkgs
@timotree3
timotree3 / pre-commit
Last active March 19, 2017 03:38
My holochain githooks (put in .git/hooks)
#!/bin/bash
if [ -n "$(gofmt -s -l .)" ]; then
echo "\`gofmt -s -w .\` your code."
exit 1
fi
@wdullaer
wdullaer / install.sh
Last active April 3, 2025 19:08
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@arobson
arobson / abstractions.md
Last active October 14, 2021 06:46
Rabbit.MQ + Node.js Notes

Abstraction Suggestions

Summary: use good/established messaging patterns like Enterprise Integration Patterns. Don't make up your own. Don't expose transport implementation details to your application.

Broker

As much as possible, I prefer to hide Rabbit's implementation details from my application. In .Net we have a Broker abstraction that can communicate through a lot of different transports (rabbit just happens to be our preferred one). The broker allows us to expose a very simple API which is basically:

  • publish
  • request
  • start/stop subscription
@isaacsanders
isaacsanders / Equity.md
Created January 21, 2012 15:32
Joel Spolsky on Equity for Startups

This is a post by Joel Spolsky. The original post is linked at the bottom.

This is such a common question here and elsewhere that I will attempt to write the world's most canonical answer to this question. Hopefully in the future when someone on answers.onstartups asks how to split up the ownership of their new company, you can simply point to this answer.

The most important principle: Fairness, and the perception of fairness, is much more valuable than owning a large stake. Almost everything that can go wrong in a startup will go wrong, and one of the biggest things that can go wrong is huge, angry, shouting matches between the founders as to who worked harder, who owns more, whose idea was it anyway, etc. That is why I would always rather split a new company 50-50 with a friend than insist on owning 60% because "it was my idea," or because "I was more experienced" or anything else. Why? Because if I split the company 60-40, the company is going to fail when we argue ourselves to death. And if you ju

@etrepat
etrepat / bundler-exec.sh
Created December 12, 2011 11:03
Automatically run Ruby scripts with "bundle exec". Source: gma/bundler-exec
#!/bin/bash
BUNDLED_COMMANDS="${BUNDLED_COMMANDS:-
cap
capify
cucumber
foreman
guard
haml
heroku