Skip to content

Instantly share code, notes, and snippets.

View sloev's full-sized avatar
https://www.buymeacoffee.com/sloev

sloev sloev

https://www.buymeacoffee.com/sloev
View GitHub Profile
@sloev
sloev / split_videos.py
Last active November 26, 2021 12:33
split_video_and_concat_data
from multiprocessing.dummy import Pool
import subprocess
import tempfile
import logging
import time
import random
import os
from base64 import urlsafe_b64encode
import uuid
@sloev
sloev / README.md
Last active November 25, 2021 07:57
highlight psql error

debug psql statements

when you get stuff like this:

5 UTC [1] LOG:  database system is ready to accept connections
db_1                | 2021-11-24 09:58:49.133 UTC [83] ERROR:  invalid input value for enum task_status: "ready" at character 339
db_1                | 2021-11-24 09:58:49.133 UTC [83] STATEMENT:  BEGIN;

its nice to be able to quickly figure out where the error is in the input sql file.

@sloev
sloev / kv_store.sh
Created November 25, 2021 07:25
bash key value store using jq
#!/bin/bash
# append-only kv-store using jq as querying mechanism
# author: sloev.github.io
# declare kv store as string
kv_store=""
# append some json to
@sloev
sloev / README.md
Last active March 8, 2022 12:03
gpspipe log time with micros and lat lon, python3 only
curl 'https://gist.githubusercontent.com/sloev/5de3ed6bc5d3e78f656029071eb16409/raw/728aee9e9a88281d7bcb398f2408aa5051632c1d/gpslog.py' > ~/gpslog.py 
    
curl 'https://gist.githubusercontent.com/sloev/5de3ed6bc5d3e78f656029071eb16409/raw/728aee9e9a88281d7bcb398f2408aa5051632c1d/gpslog.sh' > ~/gpslog.sh 
    
curl 'https://gist.githubusercontent.com/sloev/5de3ed6bc5d3e78f656029071eb16409/raw/728aee9e9a88281d7bcb398f2408aa5051632c1d/gpslog.service' > ~/gpslog.service

sudo cp ~/gpslog.service /etc/systemd/system/gpslog.service
sudo systemctl enable gpslog.service
@sloev
sloev / hub.go
Created March 1, 2022 09:03
single file broadcast webserver in golang
package hub
import (
"bytes"
"log"
"net/http"
"sync"
"time"
"github.com/gorilla/websocket"
@sloev
sloev / mejeriet.lua
Created October 26, 2022 22:26
vjing with loaf and chataigne
-- create new images
vPlayer1 = of.VideoPlayer()
outputFbo = of.Fbo()
serverTemp = syphon.Server()
serverOutput = syphon.Server()
outputWidth = 1280
outputHeight = 720
previewWidth = 400
@sloev
sloev / tree.gd
Created February 12, 2023 19:57
godot parallax
extends TextureRect
var shader_material
var screen_size
func _ready():
screen_size = OS.get_screen_size()
shader_material = self.material
set_process_input(true)
@sloev
sloev / keras_to_pb.py
Created March 14, 2023 20:39
convert keras 2.3.1 model to onnx 1.13.1
import pickle
import json
import tensorflow as tf
from keras.models import load_model
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from keras.layers import Dense, Embedding, LSTM
import tensorflow as tf
@sloev
sloev / README.md
Created March 16, 2023 10:35
use gitjournal
  1. create repo

  2. install https://gitjournal.io/ on phone

  3. setup gitjournal on phone

  4. clone repo on computer

  5. install script alias

@sloev
sloev / index.js
Last active September 15, 2023 21:13
index.js
(async () => {
const GUN = require('gun');
const dbName = "database" + new Date()
require('gun/lib/path.js')
var SEA = GUN.SEA;
var gun = GUN()
// 1......
// create server certificate for database (allowing server to delete all user objects)
var ServerAdmin = await SEA.pair()