Skip to content

Instantly share code, notes, and snippets.

View thevinter's full-sized avatar

Nikita Brancatisano thevinter

View GitHub Profile
@thevinter
thevinter / claude-session.fish
Created February 12, 2026 12:21
fish function that launches a claude code session in a separate worktree
function claude-session
set repo_root (git rev-parse --show-toplevel 2>/dev/null)
if test $status -ne 0
echo "Not in a git repo, launching claude normally"
claude $argv
return
end
set base_branch (git symbolic-ref --short HEAD)
@thevinter
thevinter / parse_spelldump.js
Created August 2, 2024 12:36
Creates a readable diff (skipping arbitrary values) on two SimC SpellDumps
import fs from 'fs'
import * as jsondiffpatch from 'jsondiffpatch'
const diffInstance = jsondiffpatch.create({
objectHash: function (obj) {
// this function is used only to when objects are not equal by ref
return obj._id || obj.id
},
})
@thevinter
thevinter / parse_spelldump.js
Created August 2, 2024 03:57
Shows the diff between two Simc Spell Dumps
const fs = require('fs')
// Read the file
function parseFile(filename, callback) {
fs.readFile(filename, 'utf8', (err, data) => {
if (err) {
console.error(err)
return
}
{"total":3,"list":[{"id":"61f049424f347211410b0d51","title":{"code":"media-title-61f049424f347211410b0d51","translations":{"en":"","it":"Running Burn"}},"shortDescription":{"code":"media-shortdescription-61f049424f347211410b0d51","translations":{"en":"","it":"Obiettivo? Aumentare e migliorare le proprie tecniche di corsa. Il programma comprende tutte e 4 le andature proposte dalle più lente (walk) a quelle più performanti (sprint)."}},"fullDescription":{"code":"media-fulldescription-61f049424f347211410b0d51","translations":{"en":"","it":"Obiettivo? Aumentare e migliorare le proprie tecniche di corsa. Il programma comprende tutte e 4 le andature proposte dalle più lente (walk) a quelle più performanti (sprint)."}},"duration":0,"mainTrainer":"61f02951587ff91062d0d7db","mediaType":0,"activity":{"id":"61f028314f347211410b0d4a","name":{"code":"activity-name-61f028314f347211410b0d4a","translations":{"en":"Running","it":"Running"}}},"mainPlaylist":"","levelOfDifficulty":"0","allowedUserRoles":[""],"numberOfLikes":0,
def mat(M):
"""verifica se M è una matrice"""
m = M[0]
n = M[1]
L = M[2]
if not(type(M)==tuple and len(M)==3):
return False
if not(type(L)==list and len(L)==m*n):
return False
if not(type(m)==type(n)==int and m>0 and n>0):
def mat(M):
"""verifica se M è una matrice"""
m = M[0]
n = M[1]
L = M[2]
if not(type(M)==tuple and len(M)==3):
return False
if not(type(L)==list and len(L)==m*n):
return False
if not(type(m)==type(n)==int and m>0 and n>0):
def mat(M):
"""verifica se M è una matrice"""
if not(type(M)==tuple and len(M)==3):
return False
m,n,L=M
if not(type(m)==type(n)==int and m>0 and n>0):
return False
if not(type(L)==list and len(L)==m*n):
return False
return all(type(x)==int for x in L)
def mat(M):
"""verifica se M è una matrice"""
if not(type(M)==tuple and len(M)==3):
return False
m,n,L=M
if not(type(m)==type(n)==int and m>0 and n>0):
return False
if not(type(L)==list and len(L)==m*n):
return False
return all(type(x)==int for x in L)
def mat(M):
"""verifica se M è una matrice"""
if not(type(M)==tuple and len(M)==3):
return False
m,n,L=M
if not(type(m)==type(n)==int and m>0 and n>0):
return False
if not(type(L)==list and len(L)==m*n):
return False
return all(type(x)==int for x in L)
import random
from ausiliarie import is_istogramma, is_markov_analysis, int_pos, word as is_word
def bsearch_first_geq(lst, p):
search = lst[:]
index = 0
while search:
i = len(search) // 2
_, val = search[i-1]
if val < p: