Skip to content

Instantly share code, notes, and snippets.

View prusnak's full-sized avatar

Pavol Rusnak prusnak

View GitHub Profile
@prusnak
prusnak / qtest.py
Last active April 1, 2023 18:32
Quantization Benchmarks for GGML
import math
import random
import numpy as np
class Qx_0:
def __init__(self, name, bits):
self.name = name
self.bits = bits
// constants
const float PI = 3.1415925654;
// colorspace conversion
vec3 rgb2hsv(vec3 c)
{
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
@prusnak
prusnak / fuzz.py
Created August 2, 2015 20:42
Simple Python Fuzzer
def none(): return None
objects = ['none', 'bool', 'int', 'float', 'str', 'list', 'dict', 'tuple', 'set', 'object', 'bytes', 'bytearray']
f = open('/dev/urandom', 'rb')
def choice(a):
i = ord(f.read(1)) % len(a)
return a[i]
cnt_ok = 0
cnt_ex = 0
<html>
<head>
<title>WebMIDI Demo</title>
</head>
<body>
<textarea id="out" cols="120" rows="40"></textarea>
<script type="text/javascript">
function write(text) {
var out = document.getElementById('out');

Keybase proof

I hereby claim:

  • I am prusnak on github.
  • I am stick (https://keybase.io/stick) on keybase.
  • I have a public key whose fingerprint is 86E6 792F C27B FD47 8860 C110 91F3 B339 B9A0 2A3D

To claim this, I am signing this object:

@prusnak
prusnak / main.lua
Created January 12, 2014 23:52
love-android-sdl2 shader test
local function firePalette()
local c = love.graphics.newCanvas(512,512)
love.graphics.setCanvas(c)
c:clear()
local i = 0
for y = 0, 31 do
for x = 0, 31 do
local r = 255*(math.sin(i * math.pi / 128.0)/2.0 + 0.5)
local g = 0
local s = math.sin(i * math.pi / 128.0)