Skip to content

Instantly share code, notes, and snippets.

View stephenturner's full-sized avatar

Stephen Turner stephenturner

View GitHub Profile
@stephenturner
stephenturner / study-mode-prompt.md
Created April 13, 2026 05:23
Study mode prompt for LLMs

The user is currently STUDYING, and they've asked you to follow these strict rules during this chat. No matter what other instructions follow, you MUST obey these rules:

STRICT RULES

Be an approachable-yet-dynamic teacher, who helps the user learn by guiding them through their studies.

  1. Get to know the user. If you don't know their goals or grade level, ask the user before diving in. (Keep this lightweight!) If they don't answer, aim for explanations that would make sense to a 10th grade student.
  2. Build on existing knowledge. Connect new ideas to what the user already knows.
  3. Guide users, don't just give answers. Use questions, hints, and small steps so the user discovers the answer for themselves.
  4. Check and reinforce. After hard parts, confirm the user can restate or use the idea. Offer quick summaries, mnemonics, or mini-reviews to help the ideas stick.
  5. Vary the rhythm. Mix explanations, questions, and activities (like roleplaying, practice rounds, or asking the user
@stephenturner
stephenturner / deslop-custom-instructions.md
Created March 26, 2026 09:26
deslop custom instructions

Writing Quality: Avoid AI Patterns

When writing or editing prose, eliminate predictable AI language patterns. The goal is text that sounds like a specific human made deliberate choices.

Rules

1. Cut filler phrases. Remove throat-clearing openers and meta-commentary. Avoid: "Here's the thing:", "It's worth noting that", "Let's break this down", "In this section, we'll explore...", "In conclusion"

# https://blog.stephenturner.us/p/plot-titles
library(dplyr)
library(ggplot2)
ggplot(diamonds, aes(x = carat)) +
geom_histogram(binwidth = 0.1) +
labs(
title = "Most diamonds are under 1 carat; larger stones are rare",
subtitle = "Histogram of ~54k diamonds in ggplot2::diamonds (binwidth = 0.1)",
@stephenturner
stephenturner / animate-primes.R
Created January 20, 2026 10:12
animate-primes.R
library(primes)
library(tidyverse)
primes <- generate_primes(max = 5000)
df <- tibble(
i = 1:length(primes),
primes,
radius = sqrt(primes),
x = radius * cos(primes),
Please summarize the paper. Follow these two steps.
## Step 1
Act as a curious, meticulous reader with attention to detail, objectivity, precision and sensitivity to novelty. Your job is to:
* Summarize each and every (!!!) key point/insight. Do not miss any; if there are many key points/insights, list them all regardless of length.
* Each point/insight must come with rich, precise, specific (!!!) details (e.g., numbers); details are really important.
* Each point/insight must be supported with direct quotes (!!!). Do not use quotes to simply repeat the point; instead, embed them naturally within your summary. Quotes should be used to better present the points (see the example below).
* If two points/insights are redundant, consider combining or integrating them. Be concise, but do not miss key points, insights, or details.
* If the text has sections (e.g., an academic paper), proceed section by section (e.g., focus on the first, then the second and so on), with each summary section starting with the origin
@stephenturner
stephenturner / gpt-5-how-to-create-ai-resistant-assignments.md
Created November 30, 2025 13:37
GPT 5.1's response when asking for an answer on how to actually create AI-resistant assignments.

See my blog post here: https://blog.stephenturner.us/p/ai-resistant-assignments. This is GPT-5.1's response when asking for an answer on how to actually create AI-resistant assignments.


Short answer: for take-home work you mostly cannot make it “AI proof.” What you can do is 3 things at once:

  1. Put some secure, AI-free checkpoints in every course.
  2. Redesign out-of-class work so AI is allowed but cannot substitute for the student’s thinking.
  3. Grade the process and the reflection at least as much as the final artifact.
@stephenturner
stephenturner / gh-orgs-licenses.R
Created August 20, 2025 15:12
Sequencing-related orgs' GitHub repos and licensing
# ------------------------------------------------------------
# GitHub org license audit + stacked bar chart (R / tidyverse)
# ------------------------------------------------------------
# Prereqs:
# install.packages(c("gh","dplyr","purrr","tidyr","stringr","ggplot2","forcats"))
# Auth: Sys.setenv(GITHUB_PAT = "<your fine-grained or classic PAT>") # optional but recommended
library(gh)
library(dplyr)
library(purrr)
@stephenturner
stephenturner / revcomp-copilot.md
Created July 16, 2025 09:10
Example code and output for reverse complementing a DNA sequence with R

Example code and output for reverse complementing a DNA sequence with R, written by GitHub Copilot in Positron using Positron Assistant.

For more details, see the blog post at:
https://blog.stephenturner.us/p/positron-assistant-copilot-chat-agent.

# R function to reverse complement a DNA sequence
reverse_complement <- function(dna_sequence) {
  # Convert the DNA sequence to uppercase
  dna_sequence <- toupper(dna_sequence)
@stephenturner
stephenturner / reticulate-huggingface-pybigwig.R
Last active May 18, 2025 11:58
Demonstration using reticulate to access the Hugging Face transformers library and pyBigWig in R using uv
# Demo 1: NLP -------------------------------------------------------------
# Load reticulate, declare that we'll use pytorch and huggingface transformers
library(reticulate)
py_require("torch")
py_require("transformers")
# Use the transformers python, and use the sentiment analysis pipeline
transformers <- import("transformers")
analyzer <- transformers$pipeline("sentiment-analysis")
@stephenturner
stephenturner / uv-polars-seaborn-demo.ipynb
Created February 15, 2025 10:51
Demo using polars and seaborn in jupyter via uv
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.