Skip to content

Instantly share code, notes, and snippets.

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

sloev / Johannes Valbjørn sloev

https://www.buymeacoffee.com/sloev
View GitHub Profile
@sloev
sloev / gist:8554e028ef8f7ccc942222b047b2525d
Created March 1, 2024 10:32
realtime microphone to spectrogram to imagehash
import ffmpeg
import numpy as np
import cv2
import sys
# pip install ffmpeg-python
# pip install opencv-python
# pip install opencv-contrib-python
@sloev
sloev / index.js
Created February 29, 2024 12:05
microphone to spectrogram to phash realtime using ffmpeg and nodejs
import Pipe2Pam from 'pipe2pam';
import process from 'node:process';
import {spawn} from 'child_process';
import imghash from 'imghash';
let counter = 0;
const params = [
'-loglevel',
@sloev
sloev / gist:52f79e0b3923de439257e97aed7a7da4
Last active January 13, 2024 17:03
install windows / linux on lenovo x131e chromebooks
1. open up computer and flip write switch to not-write protected
remove battery from chromebook
remove power
add power
hold esc+refresh while powering on computer
go through and press enter
power off
power on
ctrl+d
wait for dev transitioning
https://www.myfonts.com/products/modern-twenty-atmodern-twenty-342197
https://render.myfonts.net/fonts/font_rend.php?id=329faf6da65317e72cd89ca34784223f&rt=You%20Make%20Me%20Smile&rs=5000&w=40000&rbe=&sc=2&nie=true&fg=94CC65&bg=000000&ft=&nf=1
@sloev
sloev / db.js
Created September 19, 2023 19:27
import crypto from 'crypto'
import GUN from 'gun';
import 'gun/sea.js';
import 'gun/lib/open.js'
import 'gun/lib/load.js'
import { sha256 } from 'js-sha256';
import Geohash from 'latlon-geohash';
@sloev
sloev / db.js
Created September 19, 2023 13:35
import crypto from 'crypto'
import GUN from 'gun';
import 'gun/sea.js';
import 'gun/lib/open.js'
import { sha256 } from 'js-sha256';
var SEA = GUN.SEA;
var gun = GUN()
@sloev
sloev / test.js
Last active September 17, 2023 21:30
gundb last test before quiting
(async () => {
const GUN = require('gun');
const suffix = Date.now()
require('gun/sea')
var SEA = GUN.SEA;
var gun = GUN()
async function auth( username, password ) {
return new Promise(( resolve, reject ) => {
gun.user()
.auth( username, password, ack =>
@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()
@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 / 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