This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:greeting // Label: This stores in memory as a pointer (same for all references to this label) | |
set_tx "message.greeting" // Set the text, clear decision list | |
add_dc "message.good" // Set decision | |
add_dc "message.bad" | |
decide // The program yields, then moves the result (index) to register #D | |
if D=="message.good" // Maybe test suits to check that "message.good" REALLY exists, in order to avoid typos | |
set_tx "message.me_too" | |
continue // The first option will be continue | |
decide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Without Modifiers: | |
Instance methods are async, this means that you can call a method in the same object from different threads at the same time and they will be executed as well *at the same time*, without locking | |
Synchronized Method: | |
Synchronized Methods of the *SAME INSTANCE* can't be in execution at the same time, even if they are different methods. | |
Synchronized Blocks: | |
2 or more synchronized blocks with the same reference (the argument) can't be in execution at the same time. | |
Doing a synchronized block with the instance (this) as reference has the same behaviour as a Synchronized Method but with no need of making the entire method synchronized. | |
In order to add "global synchronization" on a block, you can set the class of the instance or any other static object as reference. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import PIL | |
from PIL import Image | |
if not os.path.exists("resized"): | |
os.makedirs("resized") | |
for (dirpath, dirnames, files) in os.walk("."): | |
for _file in files: | |
if ".png" in _file: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local TAG_MATCH = "[%a%d#=_-]+"; | |
function tagize(tag) | |
if tag:sub(1, 2)=="</" then | |
local pos1, pos2 = tag:find(TAG_MATCH); | |
return { | |
tag = tag:sub(pos1, pos2), | |
mode = 0, | |
}; | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.UUID; | |
import java.util.function.Consumer; | |
import org.bukkit.Bukkit; | |
import org.bukkit.entity.Player; | |
import org.bukkit.event.EventHandler; | |
import org.bukkit.event.Listener; | |
import org.bukkit.event.player.PlayerCommandPreprocessEvent; | |
import org.bukkit.plugin.Plugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
## CONFIGURATION ### | |
# MySQL Connection # | |
$sql_host = ""; | |
$sql_username = ""; | |
$sql_password = ""; | |
$sql_dbname = ""; | |
# Strings # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>MiniBoardGames Web-Stats</title> | |
<meta charset="utf-8"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mx.com.rodel.utils; | |
import org.bukkit.Bukkit; | |
import org.bukkit.entity.Player; | |
/** | |
* Sound helper enum | |
* | |
* Select one sound and play it, in 1.7/1.8/1.9/1.10 | |
* |