Skip to content

Instantly share code, notes, and snippets.

View rz7d's full-sized avatar

azure rz7d

  • Oita, Japan
View GitHub Profile
private int getPing(Player player) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchFieldException {
Method method = player.getClass().getDeclaredMethod("getHandle");
method.setAccessible(true);
Object handle = method.invoke(player);
return ((Integer) handle.getClass().getField("ping").get(handle)).intValue();
}
/**
* @param map Map to cast
* @return cast map
*/
@SuppressWarnings("unchecked")
public static <K, V> Map<K, V> castMap(Map<?, ?> map) {
Map<K, V> result = new HashMap<K, V>();
for ( Entry<?, ?> entry : map.entrySet() ) {
result.put((K) entry.getKey(), (V) entry.getValue());
}
@rz7d
rz7d / Counter.java
Last active November 25, 2016 16:20
Counter API
package com.github.stilllogic20.counter.api;
import java.lang.*;
public interface Counter {
public void countUp();
public void countDown();
@rz7d
rz7d / depends.exe.manifest
Created February 8, 2017 17:02
VisualStyleを有効化するためのマニフェストファイル
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="2.2.6000.0"
processorArchitecture="X86"
name="Microsoft Corporation.Dependency Walker.Dependency Walker"
type="win32"
/>
<description>Dependency Walker for Win32 (x86)</description>
<dependency>
@rz7d
rz7d / KBKiller.bat
Last active March 12, 2017 01:55
更新を無理やりアンインストールするバッチファイルです。テレメトリ関連の更新プログラムを消すときにお使いください。
@echo off
rem アンインストール対象の更新プログラム
set TARGET_KB=2952664
title KB Killer (Target: KB%TARGET_KB%)
:check
systeminfo 2>NUL | find "KB%TARGET_KB%" >NUL
if errorlevel 1 (
@rz7d
rz7d / colorf-enum-values-abc.txt
Last active October 7, 2017 15:12
ColorF Enumeration (ABC)
AliceBlue = 0xF0F8FF, // #F0F8FF
AntiqueWhite = 0xFAEBD7, // #FAEBD7
Aqua = 0x00FFFF, // #00FFFF
Aquamarine = 0x7FFFD4, // #7FFFD4
Azure = 0xF0FFFF, // #F0FFFF
Beige = 0xF5F5DC, // #F5F5DC
Bisque = 0xFFE4C4, // #FFE4C4
Black = 0x000000, // #000000
BlanchedAlmond = 0xFFEBCD, // #FFEBCD
Blue = 0x0000FF, // #0000FF
@rz7d
rz7d / venturechat.pom.xml
Last active September 4, 2018 03:42
pom.xml for VentureChat
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mineverse.Aust1n46.chat</groupId>
<artifactId>venturechat</artifactId>
<version>2.12.4</version>
<name>VentureChat</name>
(() => {
const stretch = true;
const drawLocalImage = imgData => {
var canvas = document.querySelector('.drawing-board-canvas')
var ctx = canvas.getContext('2d')
var image = new Image();
var size = Math.min(canvas.width, canvas.height);
image.onload = function () {
--- git-prompt-original.sh 2018-08-21 11:04:58.000000000 +0900
+++ git-prompt.sh 2018-10-17 20:39:23.715727800 +0900
@@ -9,12 +9,8 @@ if test -f ~/.config/git/git-prompt.sh
then
. ~/.config/git/git-prompt.sh
else
- PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]' # set window title
+ PS1='\033]0;$PWD\007' # set window title
PS1="$PS1"'\n' # new line
- PS1="$PS1"'\[\033[32m\]' # change to green
--- a/make/autoconf/flags-cflags.m4
+++ b/make/autoconf/flags-cflags.m4
@@ -561,8 +561,8 @@
-qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \
-qlanglvl=noredefmac -qnortti -qnoeh -qignerrno -qstackprotect"
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
- TOOLCHAIN_CFLAGS_JVM="-nologo -MD -MP"
- TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:wchar_t-"
+ TOOLCHAIN_CFLAGS_JVM="-nologo -MD -MP -source-charset:utf-8"
+ TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:wchar_t- -source-charset:utf-8"