Skip to content

Instantly share code, notes, and snippets.

function selectIfPreviousAll(base, previous) {
var matches = [];
document.querySelectorAll(base).forEach(function(e) {
var siblings = e.parentElement.childNodes;
if(siblings.length < 2)
return;
var eIndex = Array.prototype.indexOf.call(siblings, e);
matches.push(siblings[eIndex - 1]);
@xsbee
xsbee / convolve.py
Created July 21, 2022 06:00
Arbitrarily-sized image convolution using SciPy
import numpy
from PIL import Image
from sys import argv
from scipy import ndimage
target = Image.open(argv[1])
kernel = Image.open(argv[2])
// 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;
@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
@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」) は、金銭的、法律的、評判、精神的または身
# 体的損害について責任を負わないものとします。 自己責任。
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 / 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.
*
#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 / 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];
#!/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"