Skip to content

Instantly share code, notes, and snippets.

View zyuiop's full-sized avatar

Louis Vialar zyuiop

  • Lausanne, Switzerland
View GitHub Profile
@zyuiop
zyuiop / Example.java
Created August 8, 2015 15:25
Blocking world downloader
class Example extends JavaPlugin {
public void onEnable() {
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "WDL|CONTROL");
Bukkit.getMessenger().registerIncomingPluginChannel(this, "WDL|INIT", (s, player, bytes) -> {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeInt(1);
out.writeBoolean(false);
out.writeInt(1);
out.writeBoolean(false);
out.writeBoolean(false);
@zyuiop
zyuiop / README.MD
Last active August 6, 2024 20:01
A simple tool to manage scoreboards in minecraft (lines up to 48 characters !). /

About

This class allow you to use a scoreboard as a sign in which you can write any text. It is designed to be used with a CraftBukkit server (or any similar variant). It uses fake teams to allow lines that are longer than usernames.

Other versions

import time
import mcstatus
import json
from os import path
import shutil
import sys
import datetime
PATH = path.dirname(path.abspath(__file__))
PINGS_PATH = PATH + "/pings.txt"
@zyuiop
zyuiop / TetraHexaDecaunalInteger.java
Last active October 11, 2015 14:06
Because we all want to count in base 42.
import java.util.Arrays;
import java.util.List;
/**
* @author zyuiop
*/
public class TetraHexaDecaunalInteger {
private int[] factors;
private List<Character> characters = Arrays.asList('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F');
@zyuiop
zyuiop / upload.sh
Created October 16, 2015 23:19
Upload a file to a VPS with a random name
#!/bin/bash
fileName=$1
targetName=$(date +%s | sha256sum | base64 | head -c 8)
file=$(basename "$fileName")
extension="${file##*.}"
scp $fileName vps:~/screenshots/$targetName"."$extension
echo "http://i.zyuiop.net/"$targetName"."$extension | xclip -selection c
echo "Uploaded "$targetName"."$extension" ! URL copied to clipboard."
import java.util.Random;
import java.util.Scanner;
/**
* @author zyuiop
*/
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Map seed : ");
import java.util.*;
/**
* @author zyuiop
*/
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Map seed : ");
long seed = scanner.nextLong();
word = input("Expression > ")
step = int(input("Decallage > "))
word = word[::-1] # Reverse letters order
def decryptLetter(letter, key):
pos = ord(letter)
upBound, downBound = 0, 0
if pos >= 97 and pos <= 122:
def createServer(gametype, maps, scoreLimit, basePort, portId):
# Main
hasRotation = len(maps) > 1
filename = ""
conf = "sv_name zyuiop.net - Public "
motd = "zyuiop's public Teeworlds servers - "
if hasRotation:
conf += gametype.upper()
filename = gametype

Keybase proof

I hereby claim:

  • I am zyuiop on github.
  • I am zyuiop (https://keybase.io/zyuiop) on keybase.
  • I have a public key whose fingerprint is 40E6 B2FB E32E AC41 8E30 E11D 24D2 39F0 A61B 9EEA

To claim this, I am signing this object: