Skip to content

Instantly share code, notes, and snippets.

@weihao
weihao / OfflineUUID.java
Created February 6, 2023 19:26 — forked from games647/OfflineUUID.java
Generate a offline uuid based on the minecraft player name
import com.google.common.base.Charsets;
import java.util.UUID;
public class OfflineUUID {
public static void main(String[] test) throws Exception {
UUID.nameUUIDFromBytes(("OfflinePlayer:" + "playerName").getBytes(Charsets.UTF_8));
}
@weihao
weihao / fomo.sol
Created July 20, 2021 22:41 — forked from hayeah/fomo.sol
fomo3d contract
pragma solidity ^0.4.24;
/**
* @title -FoMo-3D v0.7.1
* ┌┬┐┌─┐┌─┐┌┬┐ ╦╦ ╦╔═╗╔╦╗ ┌─┐┬─┐┌─┐┌─┐┌─┐┌┐┌┌┬┐┌─┐
* │ ├┤ ├─┤│││ ║║ ║╚═╗ ║ ├─┘├┬┘├┤ └─┐├┤ │││ │ └─┐
* ┴ └─┘┴ ┴┴ ┴ ╚╝╚═╝╚═╝ ╩ ┴ ┴└─└─┘└─┘└─┘┘└┘ ┴ └─┘
* _____ _____
* (, / /) /) /) (, / /) /)
* ┌─┐ / _ (/_ // // / _ // _ __ _(/
* ├─┤ ___/___(/_/(__(_/_(/_(/_ ___/__/_)_(/_(_(_/ (_(_(_
@weihao
weihao / winter.gif
Last active December 8, 2019 01:25
winter.gif
import java.math.BigInteger;
import java.util.Scanner;
public class RationalRatio {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] s = sc.nextLine().split(" ");
int repeating_digits = Integer.parseInt(s[1]);
String[] split = s[0].split("\\.");
import java.awt.*;
import java.util.*;
import java.util.List;
public class CopsAndRobbers {
static long one = 1;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
@weihao
weihao / zombies.md
Created June 17, 2018 16:08 — forked from defunkt/zombies.md
—All You Zombies— by Robert A. Heinlein

All You Zombies

2217 Time Zone V (EST) 7 Nov. 1970--NTC-- "Pop's Place": I was polishing a brandy snifter when the Unmarried Mother came in. I noted the time---10:17 P. M. zone five, or eastern time, November 7th, 1970. Temporal agents always notice time and date; we must.

The Unmarried Mother was a man twenty--five years old, no taller than I am, childish features and a touchy temper. I didn't like his looks---I never had---but he was a lad I was here to recruit, he was my boy. I gave him my best barkeep's smile.

Maybe I'm too critical. He wasn't swish; his nickname came from what he always said when some nosy type asked him his line: "I'm an unmarried mother." If he felt less than murderous he would add: "at four cents a word. I write confession stories."

If he felt nasty, he would wait for somebody to make something of it. He had a lethal style of infighting, like a female cop---reason I wanted him. Not the only one.