Skip to content

Instantly share code, notes, and snippets.

@VisborN
VisborN / json_uncomment_test.go
Created February 20, 2025 14:28
json_uncomment
package jsonUncomment
import (
"encoding/base64"
"regexp"
"testing"
"github.com/stretchr/testify/require"
)
@VisborN
VisborN / .zshrc
Last active September 4, 2025 16:08
typeset -U path PATH
adddate_log() { while IFS= read -r line; do printf "\033[90m%s\033[0;m %s\n" "$(date -u +"%a, %d %b %Y %H:%M:%S UTC")" "$line"; done ; }
add_git_config_env() { if [ -z "$1" ] || [ -z "$2" ]; then echo "Usage: add_git_config_env <key> <value>" ; return 1 ; fi ; ; local count=${GIT_CONFIG_COUNT:-0} ; export GIT_CONFIG_KEY_${count}="$1" ; export GIT_CONFIG_VALUE_${count}="$2" ; ((count++)) ; export GIT_CONFIG_COUNT=${count} ; }
if [[ ! -a ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ]]; then git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ; fi
if [[ ! -a ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions ]]; then git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions ; fi
@VisborN
VisborN / main.dart
Created March 26, 2021 01:11
dartpad flutter minkowski sousage
import 'dart:math' as math;
import 'dart:async';
import 'package:flutter/material.dart';
class MyPainter extends CustomPainter {
final _matrixQuarter = Matrix4.identity().scaled(0.25, 0.25, 1).storage;
final _matrix90 = Matrix4.rotationZ(-math.pi / 2).storage;
final _matrix180 = Matrix4.rotationZ(-math.pi).storage;
final int iteration;
package main
import (
"bufio"
"fmt"
"io/ioutil"
"os"
"runtime"
"sync"
)