Skip to content

Instantly share code, notes, and snippets.

@xsbee
xsbee / bfs_find.zig
Last active May 15, 2023 17:20
Breadth-first search cheap-version of GNU find in Zig
const std = @import("std");
const allocator = std.heap.c_allocator;
const DirQueue = std.TailQueue(std.fs.IterableDir);
pub fn main() !void {
var argv = try std.process.argsWithAllocator(allocator);
defer argv.deinit();
_ = argv.skip();
@xsbee
xsbee / pg-viewer.c
Last active July 7, 2023 06:32
Periodogram viewer
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include "SDL.h"
#include <fftw3.h>
#include <time.h>
#!/usr/bin/env python3
import argparse
import requests
import json
from datetime import datetime
parser = argparse.ArgumentParser(
epilog="Total pages and result count will be displayed"
@xsbee
xsbee / wv-viewer.c
Created April 30, 2023 09:41
Displays waveform of default input device using SDL
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <SDL.h>
struct draw_context
{
float window[1024];
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <cairo.h>
/**
* Loads single channel 32-bit little-endian single precision
* floating point PCM data.
@xsbee
xsbee / sine.c
Last active December 6, 2022 02:17
Sweeping surface of frequency and amplitudes
/*
* sine.c
*
* Copyright 2022 xsbee <xyesbee@proton.me>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
public class Complex {
public double re;
public double im;
public Complex(double real, double imag) {
this.re = real;
this.im = imag;
}
public double mag() {
@xsbee
xsbee / loli.py
Last active September 20, 2022 18:55
Lightning speed, multithreaded, Lolicon downloader.
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Possession of materials alluding to Loli or Lolicon vary upon jurisdiction.
# Henceforth in no event shall the author ("xsbee") be liable for any damage,
# financial, legal, reputational, mental or physical. Use at your own risk.
# ロリまたはロリコンをほのめかす資料の所有は、司法管轄区によって異なります。
# 今後いかなる場合でも、著者 (「xsbee」) は、金銭的、法律的、評判、精神的または身
# 体的損害について責任を負わないものとします。 自己責任。
@xsbee
xsbee / loli.ps1
Created August 2, 2022 17:23
Multithreaded downloader of Lolicon.
# Inspired by https://github.com/poly000/lolicon_api
# The ultimate script to jail :)
$url = "https://api.lolicon.app/setu/v2?r18=1&num=20"
$entries = Invoke-WebRequest $url | ConvertFrom-Json
$jobs = @()
foreach ($entry in $entries.data.urls.original) {
$entryUri = [System.Uri]$entry
// g++ -Wall -Wextra -shared -Ofast -march=native -o vhs.dll vhs.cxx
#include <random>
struct vhs
{
unsigned int m_width;
unsigned int m_height;
unsigned int m_sr_off = 0;