Skip to content

Instantly share code, notes, and snippets.

View zimmski's full-sized avatar

Markus Zimmermann zimmski

View GitHub Profile
@zimmski
zimmski / argh_test.go
Last active November 1, 2016 22:42
Benchmark concatinating rune slices
package argh
import (
"testing"
"github.com/stretchr/testify/assert"
)
// $ go test -run=XXX -bench=.
// BenchmarkConcatAppendConcatOnce-4 5000000 262 ns/op
@zimmski
zimmski / diff-highlight
Created July 12, 2017 08:13
diff-highlight from https://github.com/git/git/tree/master/contrib/diff-highlight changed from the clean one file solution to a multi-file solution. So here it is, one file, again.
#!/usr/bin/perl
use 5.008;
use warnings FATAL => 'all';
use strict;
# Highlight by reversing foreground and background. You could do
# other things like bold or underline if you prefer.
my @OLD_HIGHLIGHT = (
color_config('color.diff-highlight.oldnormal'),
@zimmski
zimmski / not-so-floaty.java
Last active November 13, 2022 19:04
Not so floaty in Java
public class MyClass {
public static void main(String args[]) {
float x = 0.3f;
float y = 0.2f;
float z = x - y;
System.out.println(z);
float expectedZ = 0.1f;
float delta = 0.00000001f;
@zimmski
zimmski / not-so-floaty.js
Created November 22, 2023 09:28
Tampermonkey script - Google Chat Always Allow Animated Emojis (in case you have "prefers-reduced-motion" set to "reduce")
// ==UserScript==
// @name Google Chat Always Allow Animated Emojis
// @match https://chat.google.com/*
// ==/UserScript==
(function() {
'use strict';
function main() {
const pictureSources = document.querySelectorAll('picture > source');
$bash run.sh
go install -v github.com/symflower/eval-codegen-testing/...
github.com/symflower/eval-codegen-testing/model/llm
github.com/symflower/eval-codegen-testing/provider/openrouter
github.com/symflower/eval-codegen-testing/cmd/eval-codegen-testing/cmd
github.com/symflower/eval-codegen-testing/cmd/eval-codegen-testing
2024/04/03 22:49:51 Checking that models and languages can be used for evaluation
2024/04/03 22:49:51 Evaluating model "openrouter/01-ai/yi-34b" using language "golang" and repository "/home/zimmski/symflower/src/github.com/symflower/eval-symflower-codegen-testing/testdata/golang/plain"
2024/04/03 22:51:30 Model "openrouter/01-ai/yi-34b" responded to query Given the following Go code file "plain.go" with package "plain", provide a test file for this code.
The tests should produce 100 percent code coverage and must compile.