Skip to content

Instantly share code, notes, and snippets.

@simbo1905
simbo1905 / gist:1bbc1e355b00f4130d5ccded5a370d86
Last active April 24, 2025 05:58
so Claud, you got this, right?
in our implimentation of `static <T> Pickler<?> createPicklerForSealedTrait(Class<T> sealedClass)` when ever we see a
record we write out classname of the records so that we can resolve the correct pickler to deseralize it. we have
tests of complex trees where we have the same type of node many times. that bloats the final format. we want to be
future proof to new records being added to the sealed trait between serialization and deserialization. so we cannot
use a fixed map of permittted types to bytes to make the format very compact. yet there is no reason to write out a
classname to the buffer twice. instead when we currently write out a classname we can memorize the offset in the
bytebuffer where we are about to write the size of the classname then the bytes. this can be recorded in a map of
class-to-offset called classNameToOffset. then when we are about to write out a new record we can check the keys in
the map. if we have not yet written out the classname to the current buffer we can write out
@simbo1905
simbo1905 / together_ai-deepseek-ai-DeepSeek-R1-Distill-Llama-70B.md
Last active April 10, 2025 20:27
How to use the US hosted Together.AI Pro model "deepseek-ai/DeepSeek-R1-Distill-Llama-70B" with Aider

As at 7th April 2025 the company Together.AI offers hosted US hosted version of "DeepSeek R1 Distill Llama 70B". DeepSeek-R1-Distill-Llama 70B is part of the DeepSeek-R1 family. It is a denser llama architecture model trained by the bigger Mixture-of-Experts (MoE).

In order to use it with aider you need some settings changes:

Create ~/.aider.model.settings.yml:

- name: together_ai/deepseek-ai/DeepSeek-R1-Distill-Llama-70B
  edit_format: diff-fenced
 reasoning_tag: think
@simbo1905
simbo1905 / gist:92089a2f2230b7952df53e9c6cc0ffd7
Last active June 29, 2024 11:45
For_a_Fair_Deal_-_Liberal_Democrat_Manifesto_2024_-_Plain_Text.txt
ˇContents
1 Foreword 5
2 Our Fair Deal 7
3 The Economy 11
@simbo1905
simbo1905 / gist:9c68ea2ae1f0e965ad851380255bc677
Created June 29, 2024 08:46
text extracted from Change-Labour-manifesto-2024-screen-reader.pdf
Change
Labour Party Manifesto 2024
MY PLAN FOR CHANGE
This election is about change.
A chance to stop the endless Conservative chaos that has directly harmed the finances of every family in Britain.
A moment where we can turn the page on a set of ideas that, over 14 years, have consistently left us more vulnerable in an increasingly volatile world.
And an opportunity to begin the work of national renewal.
@simbo1905
simbo1905 / docker-maven-ghactions-release.md
Last active June 23, 2022 21:59 — forked from faph/docker-maven-ghactions-release.md
Automated Docker releases using Maven and GitHub Actions

Automated Docker releases using Maven and GitHub Actions

Life is too short for tedious, manual release processes.

Here, we will use Maven's [Release plugin][maven-release] to execute releases. Instead of triggering the release process manually, we will use a [GitHub Actions][gh-actions] workflow on the master branch. All development work is done on the dev branch (or feature branches) and a release is done when (and only when) the dev branch is merged with the master branch.

Mixing two frameworks will typically require that you are an expert in both to be successful. This is because making them interact will add an additional level of complexity of having to interopate between the two frameworks. That often requires detailed knowledge of the internal workings of the frameworks that you would normally just "take for granted" such as session management and caching.

The point of using a framework is that it provides out-of-the-box "known good practice" in many low-level details so you can focus on your "business logic" not the "basic plumbing". The moment you "go against the framework" and try to do complex things like "make two frameworks coexist" you are basically throwing away the main benefit of using any framework. In short, using two is likely not better than using one. It is like to be more of a case that using two will be "three times the work".

While the actual result will depend on lots of factors I would expect that you would be better off if you picked the worst fra

@simbo1905
simbo1905 / rhel8-imagechecker.sh
Created December 27, 2019 21:11
script to compare local openshfit registry tags against upstream redhat image catalogue at registry.redhat.com
#!/bin/bash
set -Eeuo pipefail
oc() {
if ! bin/oc_wrapper.sh "$@"; then
>&2 echo "ERROR oc wrapper returned none zero status"
fi
}
IMAGE_STREAM="$1"
@simbo1905
simbo1905 / nom_audit.log
Created December 24, 2019 17:01
output of `npm audit` on botkit-starter-slack as at 2019-12-24
This file has been truncated, but you can view the full file.
 
  === npm audit security report ===  
 
# Run npm install [email protected] to resolve 6 vulnerabilities
SEMVER WARNING: Recommended action is a potentially breaking change
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Critical │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ handlebars │
├───────────────┼──────────────────────────────────────────────────────────────┤
@simbo1905
simbo1905 / BlockingJournal.java
Last active November 5, 2019 12:44
out of order processing of a Flux of input using Reactor 0.9.1.RELEASE
import reactor.core.publisher.Mono;
public class BlockingJournal {
private static String blockingWrite(String in){
try {
// fakes blocking for disk write
Thread.sleep(5L);
System.out.println("journal wrote: "+in+" on "+Thread.currentThread().getName());
@simbo1905
simbo1905 / TrexTcpServer.java
Created November 3, 2019 22:10
how to write an echo server with reactor-netty 0.9.1.RELEASE
package demo;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.util.CharsetUtil;
import reactor.netty.DisposableServer;
import reactor.netty.tcp.TcpServer;
public class TrexTcpServer {