Skip to content

Instantly share code, notes, and snippets.

View saiday's full-sized avatar
:shipit:
su su su

Saiday saiday

:shipit:
su su su
View GitHub Profile
@saiday
saiday / fft_data.py
Created January 6, 2026 08:22
FFT sample data (630x125)
[
[-32.49131,-29.79542,-33.48277,-33.50104,-36.45362,-35.94827,-32.96527,-32.26936,-36.44932,-25.76287,-34.28092,-30.85497,-33.31415,-37.21161,-34.73141,-34.81738,-33.31928,-30.9516,-37.14602,-32.5547,-35.54541,-34.18177,-34.05177,-39.32136,-34.21709,-32.11923,-39.88954,-34.15068,-34.72967,-33.56728,-33.01094,-32.99736,-35.53232,-34.29665,-38.03343,-34.00711,-31.90899,-36.51534,-38.70016,-38.85773,-35.86512,-39.0494,-32.97895,-35.13379,-34.79237,-33.08383,-34.75455,-32.69923,-37.75183,-34.55227,-33.46341,-33.76085,-31.13621,-36.67093,-31.89944,-39.58604,-32.94171,-37.69374,-40.9296,-37.94635,-33.29289,-37.64688,-42.95561,-32.30759,-34.24654,-35.48082,-41.07648,-35.67988,-40.20394,-36.35468,-33.87188,-46.06673,-33.31841,-37.91453,-34.55331,-41.36814,-38.92372,-37.77615,-34.73792,-38.20335,-36.72244,-41.73395,-42.49073,-37.86463,-37.16306,-37.91299,-36.09221,-34.9044,-36.64595,-41.02642,-36.8739,-45.84547,-39.46665,-43.04192,-40.34679,-41.63593,-41.82988,-47.03239,-42.57105,-40.1003,-45.1071,-42.12825,-43.056
@saiday
saiday / fanclub.html
Created June 3, 2024 05:47
pseudo code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>URL Manipulation Example</title>
<script>
document.addEventListener('DOMContentLoaded', () => {
// Assuming URL A is 'http://example.com/pageA' and URL B is 'http://example.com/pageB'
// Step 1: Load content from URL B (this can be done via AJAX)
@saiday
saiday / visibility.py
Created January 22, 2024 10:00
bit masing for user visibility
# Constants representing each status as bit flags
ENABLE = 1 << 0 # 0b000001
BLOCKED_BY_GLOBAL = 1 << 1 # 0b000010
BLOCKED_BY_CN = 1 << 2 # 0b000100
COPYRIGHT_GLOBAL = 1 << 3 # 0b001000
COPYRIGHT_CN = 1 << 4 # 0b010000
PENDING_DELETION = 1 << 5 # 0b100000
def set_status(status_flags, condition):
"""Set a specific condition."""
package com.streetvoice.streetvoice.player;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.ShortBuffer;
import java.util.Arrays;
import java.util.LinkedList;
//
// SAWKWebView.swift
//
// Created by Costantino Pistagna on 24/01/2020.
// Copyright © 2020 Sofapps. All rights reserved.
//
import UIKit
import WebKit
import Foundation
let json = """
{
"results":[
{
"blah":"blah",
"nested_object":{
"type":"a",
"id":69,
import Foundation
let json = """
{
"results":[
{
"blah":"blah",
"nested_object":{
"type":"a",
"id":69,
@saiday
saiday / instance_method_curried_function.swift
Last active January 7, 2020 17:22
instance method curried function
class C {
func printla(_ msg: String) { print(msg) }
func getPrinter(_ msg: String) -> (String)->() { return { msg in self.printla(msg) } }
}
let c = C()
let im = C.printla // im is of type (C)->(String)->(),
im(c)("who let the dogs out") // prints "who let the dogs out"
func ~=<T>(rhs: KeyPath<T, Bool>, lhs: T) -> Bool {
lhs[keyPath: rhs]
}
func handle(_ character: Character) {
switch character {
case "<":
print("element")
case "#":
print("hashtag")
@saiday
saiday / clear_kotlin_web_view_cache.kt
Created August 20, 2019 10:34
Clear Android web view cache
//helper method for clearCache() , recursive
//returns number of deleted files
fun clearCacheFolder(dir: File?, numDays: Int): Int {
var deletedFiles = 0
if (dir != null && dir!!.isDirectory()) {
try {
for (child in dir!!.listFiles()) {
//first delete subdirectories recursively