Skip to content

Instantly share code, notes, and snippets.

View br3nt's full-sized avatar

br3nt

View GitHub Profile
@br3nt
br3nt / crash recovery prompt.md
Last active October 3, 2026 02:20
Prompt to build Claude convo crash recovery mechanism

Prompt to build a Claude conversation crash recovery tool

My computer crashes often, and auto-updates restart it without warning. Either way I lose track of which Claude Code conversations were open.

I run many conversations at once, like Chrome tabs. I come back to some weeks later. I keep others open as reminders of ideas I want to return to. When the machine restarts I want every one of them back.

So I built a tool that tracks which conversations are still open, meaning the ones I have not deliberately ended.

How I use it: after a crash or restart I open Claude and ask it to recover my conversations. Claude runs the skill this prompt installs, the skill inspects the recovery system, and Claude lists every open conversation, grouped by the directory it ran in, each with a paste-ready command that changes into that directory and resumes the conversation. I paste back the ones I want. The skill is how I drive the tool; I do not run anything in the shell myself. That is the whole point: ask Claude what w

@br3nt
br3nt / prime_number_generation.md
Last active August 21, 2023 07:37
Prime number generation in C#
@br3nt
br3nt / binary_search_js_iterative.md
Last active August 21, 2023 03:48
Binary search in JS

Features:

  • Returns the index of the search value if found, otherwise, undefined
  • No array copy
  • Iterative
function binarySearch(arr, number) {
    let start = 0
    let end = arr.length - 1
@br3nt
br3nt / backlava_js.md
Last active August 21, 2023 02:11
Backlava in Javascript

See: https://sampleprograms.io/projects/baklava/javascript/

My attempt at backlava in JS.

Fetaures and difference to other implementation:

  • memoise the spaces and stars
  • use of substr to print the number of spaces and stars
  • use of a string builder instead of string concatenation
  • the algorithm is contained within backlava()
  • backlava() returns a string rather than printing directly to the console
@br3nt
br3nt / query_language.md
Last active January 2, 2022 03:22
Ideas for SQL for structured data

Upon researching GraphQL, the question immediately came to my mind:

Why do we need another query language when we already have SQL?

A second question then came to mind:

Can we use SQL for API endpoints?

After asking this question, it now seems odd that REST style APIs would even be considered a good choice.

@br3nt
br3nt / median.js
Last active November 28, 2019 05:35
JS median and splitMedian functions
function medianSplit(array) {
let midPoint = array.length / 2
array = array.sort((a, b) => a - b)
let firstHalf = array.slice(0, Math.floor(midPoint))
let middle = array.slice(Math.floor(midPoint), Math.ceil(midPoint))[0]
let lastHalf = array.slice(Math.ceil(midPoint), array.length)
return [firstHalf, middle, lastHalf]
}
function median(array) {
@br3nt
br3nt / post-receive.rb
Last active September 16, 2019 00:23 — forked from ryanflorence/post-receive.rb
A git hook to be installed on a remote server. The remote's repo will updated when a push is made.
#!/usr/bin/env ruby
# Aside from removing Ruby on Rails specific code this is taken verbatim from
# mislav's git-deploy (http://github.com/mislav/git-deploy) and it's awesome
# - Ryan Florence (http://ryanflorence.com)
#
# Install this hook to a remote repository with a working tree, when you push
# to it, this hook will reset the head so the files are updated
if ENV['GIT_DIR'] == '.'
@br3nt
br3nt / README.md
Last active July 16, 2019 13:36
The Caves of Lemaria

One of the earliest Ruby constructs I learned about was Hash.new {|h, k| h[k] = {} }. This small one-liner is explored in many Ruby tutorials and it completely captured my imagination. I've never been able to use this in a production app as I've always found a better solution. However, one thing it might be good for is to take you on a short journey.

This journey will be interactive, so you will need to copy snippets of code into an irb or pry console. I recommend using ruby 2.6 or higher as the copy-paste functionality is better (and I havn't debugged on lower versions).

UPDATE: I've now added the caves_of_lemaria.rb script which will run through the whole adventure!

@br3nt
br3nt / Collections and encapsulating colleciton logic.md
Last active July 23, 2025 11:41
Ideas for a less verbose language as beautiful as Ruby

Need to be able to encapsulate collection logic, and chain together with Generic collection logic.

E.g. when you have a list of Node and Edge, there are certain collection functions which encapsulaet business logic that you may want to create which returns additional collections of objects, which may also have their own collection functions.

These collection functions may encapsulate specific map() or filter() behaviour for example.

The problem with may typed languages is that there is a generic class like List which provides the collection interface, but the functions return some generic interface, so when we implement in a subclass, we need to override all methods to wrap and return value in the subclass, and specify the type as the subclass instead of the interface. This is a lot of boilerplate code! But if we dont override all the methods, we can't chain our collection functions and return our specific collection functions.

@br3nt
br3nt / sketch-never-ending.md
Created November 29, 2018 00:38 — forked from Bhavdip/sketch-never-ending.md
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com