Skip to content

Instantly share code, notes, and snippets.

View S4WA's full-sized avatar

Sawa S4WA

View GitHub Profile
@S4WA
S4WA / ! Manga-Viewer.html
Last active February 25, 2024 09:42
Simple Manga Viewer
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title></title>
<style type='text/css'>
body {
margin: 2.5em 0;
background-size: 100%;
@S4WA
S4WA / example1.js
Last active November 5, 2022 07:34
console.log( response( new Date().getHours() ) );
@S4WA
S4WA / SteamOpenURL.user.js
Last active December 14, 2022 16:14
when you open a steam page on web browser, it adds "steamopenurl://" so that you can open the same thing on steam client.
// ==UserScript==
// @name SteamOpenURL
// @namespace https://akiba.cloud/
// @version 0.1
// @description try to take over the world!
// @author Drip
// @match http*://steamcommunity.com/*
// @match http*://steampowered.com/*
// @match http*://store.steampowered.com/*
// @grant window.close
@S4WA
S4WA / parseUUID.java
Last active May 20, 2020 03:07
Make parse UUID from no hyphen string (Error: "java.lang.illegalargumentexception:java.lang.illegalargumentexception: Invalid UUID string")
public static UUID parseUUID(String uuid) {
try {
return UUID.fromString(uuid);
} catch (IllegalArgumentException exception) {
return UUID.fromString(uuid.replaceFirst("(\\p{XDigit}{8})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}+)", "$1-$2-$3-$4-$5"));
}
}
@S4WA
S4WA / .java
Last active March 13, 2019 09:16
velocity
@EventHandler
private void onVelocity(PlayerVelocityEvent event) {
if (event.getPlayer().getLastDamageCause().getCause() != EntityDamageEvent.DamageCause.ENTITY_ATTACK) return;
Player damaged = event.getPlayer();
Vector vector = damaged.getVelocity();
vector.normalize();
if (!damaged.isSprinting()) {
vector = new Vector(vector.getX() * this.horizontal, 1.0D * this.vertical, vector.getZ() * this.horizontal);
} else {
@S4WA
S4WA / HWUUIDGenerator.java
Created December 11, 2018 04:52
hardware uuid gen
import java.io.BufferedReader;
import java.io.File;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.util.UUID;
public class HWUUIDGenerator {
private String uuid;
public final String onGenerateUUID() {