Skip to content

Instantly share code, notes, and snippets.

@ReiFan49
ReiFan49 / sdwebui-download.js
Last active October 11, 2022 19:00
Enable DevTools based download for StableDiffusion web-ui
// Stable Diffusion WebUI Javascript plugin
// Rei_Fan49 (c) 2022
// MIT License.
window.addEventListener('DOMContentLoaded', function(){
const sources = [
'https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js',
'https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js',
];
sources.forEach(function(src){

Prelude

Some people may have difficulty to resync the beatmap/chart timing after replacing audio. This guide will help you.

I know the offset of new audio!

As the offset for both version are known, you can play around the delta (Δ) time of it.

All you have to do is perform those in any order:

  • Move all notes by given Δms
function generateWinnerBracket(playerCounts) {
let winnerRounds = Math.ceil(Math.log2(playerCounts));
const seeds = Array.apply(null, {length: playerCounts}).map((x, i) => i + 1);
const rounds = [];
const expectedNext = [];
const expectedBuffer = [];
for(let seedPower = 1; seedPower <= winnerRounds; seedPower++) {
const round = {round: winnerRounds - seedPower + 1, matches: []};
const availableSeeds = [];
[].push.apply(availableSeeds, seeds.filter(x => x > (1 << (seedPower - 1)) && x <= (1 << seedPower)));

Keybase proof

I hereby claim:

  • I am ReiFan49 on github.
  • I am rei_fan49 (https://keybase.io/rei_fan49) on keybase.
  • I have a public key whose fingerprint is 1073 0387 E722 AE92 B3F3 EC50 7C0E DD02 F28C DA8F

To claim this, I am signing this object:

@ReiFan49
ReiFan49 / ctcwrite.rb
Created May 25, 2021 02:51
text to pixel coordinate for 東方夢終劇. credit to @danmaq for dnh code of this.
ImageCache = Struct.new(:filename, :data) do
def load
return unless File.exists?(self.filename)
self.data = nil
end
end
TextCache = Struct.new(:image_id, :x, :y, :width, :height, :kerning, :spacing)
module CtC
module SJIS
@ReiFan49
ReiFan49 / osu!lazer guide to import files on iOS.md
Created September 27, 2020 09:57
osu!lazer guide to import files (iOS)

osu!lazer import guide on iOS (no iTunes!)

Introduction

Hello, as you can see I want to share on how file importing can be done as some people wonder about custom beatmap or custom skins. In here, I'll share the guide step-by-step as long as you follow the prerequisite, sure things can be done properly.

Prerequisites

  • File sharing app. Recommended Dropbox for this guide.
  • Active osu!lazer testflight period (or actual osu! mobile build that is based from lazer). I'm not kidding.
@ReiFan49
ReiFan49 / multipart.rb
Last active June 1, 2018 07:19
simple yet lazy multipart handler on ruby
# MIT License
#
# Copyright (c) 2018 Rei Hakurei
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@ReiFan49
ReiFan49 / otogecode.rb
Last active December 17, 2017 16:22
Rhythm Game Rival Codes
KONAMI = {
SDVX: "SV-5726-1134",
DDR: "51504202",
IIDX: "9738-4180"
}
SEGA = {
maimai: "Not available", # See at https://maimai-log.net/Rei_Fan49 for tracker
}
@ReiFan49
ReiFan49 / neatjson.py
Last active May 7, 2017 15:00
Python port of neatjson gem from Ruby
import re
import json
import inspect
from collections import OrderedDict as odict
def neatify(obj,**opts):
"""
Generate the JSON string representation for an object,
with a variety of formatting options.
@ReiFan49
ReiFan49 / tgif-solve.rb
Created July 23, 2016 14:19
[201607-ABCTF] TGIF Solution
<<META
Contest: ABCTF
Author : Rei_Fan49
Team : WhiteHat
Date : 2016/07/15
META
# STL
require 'date'