Skip to content

Instantly share code, notes, and snippets.

package list
import (
"fmt"
"io"
)
// generics - swap out V1 for a new implementation
type V1 int32
type I1 interface {
@riking
riking / colorfix.js
Created January 26, 2017 01:59
color fixing code extracted from ffz
// SOURCE: https://github.com/FrankerFaceZ/FrankerFaceZ/blob/master/src/colors.js
RGBAColor.prototype.luminance = function() {
var r = bit2linear(this.r / 255),
g = bit2linear(this.g / 255),
b = bit2linear(this.b / 255);
return (0.2126 * r) + (0.7152 * g) + (0.0722 * b);
}
@riking
riking / gist:5166576
Created March 15, 2013 00:40
Mirror of the League of Legends Season 3 FAQ, retrieved on March 14, 2013

#The Season 3 Championship Series

League Championship Series (LCS)

Do the teams that qualified for the LCS have to stick with the same five members, or can they replace players?

An LCS qualifying spot belongs to the organization as a whole, and the team will be responsible for maintaining their lineup. Each team is required to have at least a starting five and two subs, but they’ll be able to rotate players the way you'd expect in any traditional sport. This includes trading players, signing free agents and releasing players from the roster.

What will happen to partner events like those run by IPL, MLG, IEM, DreamHack, etc. this coming year?

Partner events like these will host tournaments for challenger teams. Winning teams can earn a spot in the Promotion Tournament happening at the All-Star break, where they’ll have the opportunity to break into the LCS. There won’t be a circuit point system for partner events this year.

How’d you decide on the 17+ age requirement for NA and EU tournaments

javascript:(function(){var e=document.body.style.cursor;document.body.style.cursor="crosshair";var t=document.createElement("div");var n="border:1px solid #3280FF;background-color:rgba(50,128,255,0.5);position:absolute;z-index:2147483647;display:none;";var r="pointer-events:none;";var i="transition:width 60ms,height 60ms,left 60ms,top 60ms;";n+=r+"-webkit-"+r+"-moz-"+r;n+=i+"-webkit-"+i+"-moz-"+i;t.setAttribute("style",n);document.body.appendChild(t);var s=null;var o=function(e){var n=e.target;if(n!==s&&n.parentNode){var r=n.getBoundingClientRect();var i=document.documentElement;var o=document.body;var u=i.clientTop||o.clientTop||0;var a=i.clientLeft||o.clientLeft||0;var f=window.pageYOffset||i.scrollTop||o.scrollTop;var l=window.pageXOffset||i.scrollLeft||o.scrollLeft;var c=l-a+r.left-1;var h=f-u+r.top-1;t.style.display="block";t.style.left=c+"px";t.style.top=h+"px";t.style.width=r.width+"px";t.style.height=r.height+"px";s=n}};var u=function(n){document.body.style.cursor=e;if(n.target.parentNode)n.target.par
#!/usr/bin/env python
import re
import fileinput
import base64
import ast
rgx = re.compile("\"(\w+)\":")
compact = re.compile("^([A-Za-z0-9_=-]*)\\.[A-Za-z0-9_-]*=?=?.[A-Za-z0-9_-]*=?=?$")
def processjson(line):
@riking
riking / README.md
Last active January 20, 2016 19:38
Twitch Global Replacement Emotes

If an emote line has (Consensus) at the end, I won't be replacing it (because several people added it to their channel and it's the most popular version).

If you think your emote submission outperforms one of the others, please comment below and I'll change the list.

package ...;
...
import me.mrkirby153.plugins.factionsplus.utils.configuration.Village;
...
public class FactionsPlus extends JavaPlugin {
...
...
12:46:53 [INFO] --------- Help: DragonTravel --------------------
12:46:53 [INFO] /dt deletestation: Delete a station
12:46:53 [INFO] /dt home: Travel to your home
12:46:53 [INFO] /dt deletestation: Delete a station
12:46:53 [INFO] /dt ptravel: Travel to another player
12:46:53 [INFO] /dt showstations: Show available stations
12:46:53 [INFO] /dt deletestation: Delete a station
12:46:53 [INFO] /dt remlastwp: Remove the most recent waypoint
12:46:53 [INFO] /dt dismount: Get off of the dragon
12:46:53 [INFO] /dt remflight: Delete a Flight
>dt ?
12:53:14 [INFO] --------- Help: DragonTravel --------------------
12:53:14 [INFO] /dt home: Travel to your home
12:53:14 [INFO] /dt deletestation: Delete a station
12:53:14 [INFO] /dt remlastwp: Remove the most recent waypoint
12:53:14 [INFO] /dt dismount: Get off of the dragon
12:53:14 [INFO] /dt travel: Travel to another station
12:53:14 [INFO] /dt fhome: Travel to your faction home
12:53:14 [INFO] /dt help: This help
12:53:14 [INFO] /dt ctravel: Travel to some coordinates
@Console
@Command(aliases = {"help", "?", "h"},
desc = "This help",
usage = "/dt help [-p page] [subcommand]",
min = 0, max = 1,
help = "Shows more extensive help for each subcommand")
@CommandPermissions({"dt.seecommand"})
public static void help(CommandContext args, CommandSender sender) throws CommandException {
if (args.argsLength() == 0) {
sendHelpTopic(sender, DragonTravelMain.plugin.help, args.getFlagInteger('p', 1));