Skip to content

Instantly share code, notes, and snippets.

View chyyran's full-sized avatar
💮
大変よくできました!

Ronny Chan chyyran

💮
大変よくできました!
View GitHub Profile
@chyyran
chyyran / gist:3784409
Created September 25, 2012 21:02
Per Player Censor
package net.mystia.MystiaUtils;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.logging.Level;
import java.util.regex.Matcher;
@chyyran
chyyran / MystiaCensor.java
Created October 2, 2012 21:51
Some nasty source code
censorMessage = censorMessage.replaceAll("(?i)dick","male sexual organ");
censorMessage = censorMessage.replaceAll("(?i)penis","male sexual organ");
censorMessage = censorMessage.replaceAll("(?i)cock","chicken");
censorMessage = censorMessage.replaceAll("(?i)arse","buttocks");
censorMessage = censorMessage.replaceAll("(?i)asshole","butthole");
censorMessage = censorMessage.replace("ass","buttocks");
censorMessage = censorMessage.replace("Ass","buttocks");
censorMessage = censorMessage.replace("aSs","buttocks");
censorMessage = censorMessage.replace("asS","buttocks");
censorMessage = censorMessage.replaceAll("(?i)nigger","dude");
@chyyran
chyyran / SnowflakeUITest.as
Created February 12, 2013 23:24
Snowflake UI Code
import Snowflake.UI.Test.Datastructures.Console;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.ui.Keyboard;
import mx.events.EffectEvent;
import flash.display.*;
[Bindable("effectDuration")]
private var effectDuration:Number = 250;
def calc_rectangular_prism(sidea, sideb, sidec,unit="cm"):
volume = sidea*sideb*sidec
area = sidea * sideb + sideb * sidec + sidea * sidec
area = 2 * area
print "a = 2(lw+lh+wh)"
print " = 2(%sx%s+%sx%s+%sx%s)" % (str(sidea),str(sideb),str(sidea),str(sidec),str(sideb),str(sidec))
print " = 2(%s+%s+%s)" % (str(sidea * sideb),str(sidea*sidec),str(sideb*sidec))
print " = 2(%s)" % str(area/2)
print " = %s %s squared" % (str(area),unit)
print "Volume = %s %s cubed" % (str(volume),unit)
@chyyran
chyyran / MCtoIRC.py
Created April 18, 2013 00:59
Makes Minecraft color codes into mIRC color codes
#coding=utf-8
__author__ = 'ron975'
def ingame_toIRC(string):
string = string.decode("utf-8")
#Black to Black
string = string.replace(u"\u00A7"+"0", u"\u0003"+"01")
#Ingame Dark Blue to IRC Blue
string = string.replace(u"\u00A7"+"1",u"\u0003"+"02")
#Ingame Dark Green to IRC Dark Green
@chyyran
chyyran / .htaccess
Last active December 16, 2015 17:28
Custom Gyazo Viewer (replace `uploads` with the folder your images are in)
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} !/uploads/.*\.png
RewriteRule ^uploads/([^.]+)\.png /display.php?img=$1 [L,NC,QSA]
@chyyran
chyyran / steamstart.py
Created May 22, 2013 02:14
Starts a steam game from name
#coding=utf-8
__author__ = 'ron975'
"""
This file is part of Snowflake.Core
"""
import jsonrpclib
import json
import sys
import webbrowser
@chyyran
chyyran / .htaccess
Last active December 17, 2015 18:09
Gyazo Image Display v2 Includes TimThumb.
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^uploads/([^.]+)\.(png|jpg|gif|bmp) /index.php?img=$1.$2 [L,NC,QSA]
ErrorDocument 404 /uploads/error.png
@chyyran
chyyran / gist:6369030
Created August 28, 2013 17:49
Battlelog dialog box.
<div id="dialog-container"><div class="modal-overlay show"></div>
<div id="dialog-1" class="dialog hide in" style="display: block;" tabindex="-1" role="dialog" aria-hidden="false">
<header>
<a class="icon-custom icon-close " href="#" data-bind-dismiss="dialog">Close</a>
<h3>Settings</h3>
</header>
<section style="height: auto;" class="dialog-body ">
<div class="popup-prompt-logo"></div>
<div class="popup-prompt-body">
<h2>Battlelogium Settings</h2>
@chyyran
chyyran / customjs.js
Created September 2, 2013 16:54
SettingsDialog with editSettings first
function settingsDialog() {
var clearCacheButton = createDialogButton('clearCacheButton', 'showDialog(clearCacheDialog())', " Clear Cache ", "Clear Battlelogium Webcache", false);
var editSettingsButton = createDialogButton('editSettingsButton', 'wrapper.editSettings()', " Edit Settings ", "Open the settings editor", false);
var closeSettingsButton = createDialogButton('closeSettingsButton', 'closeDialog()', " Close ", "Close this dialog", true);
return createDialog("Battlelogium Settings", "Battlelogium Settings", "Clear the cache if you have problems<br />Edit settings to open the settings editor. Settings will be applied on restart", true, [editSettingsButton, clearCacheButton, closeSettingsButton]);
}