Skip to content

Instantly share code, notes, and snippets.

View AmauryCarrade's full-sized avatar
🍊
I don't hate you

Amaury Carrade AmauryCarrade

🍊
I don't hate you
View GitHub Profile
@AmauryCarrade
AmauryCarrade / mumble_status.json
Last active December 9, 2016 01:38
Mumble dump
{
"channels": [
{
"name": "Zcraft",
"path": [
"Zcraft"
],
"position": 0,
"users": [
{
@AmauryCarrade
AmauryCarrade / irc.json
Last active December 9, 2016 01:37
Script to retrieve the users list in an IRC channel without running a bot. The “bot“ does not connects to the channels. Intended to be executed periodically. Does not works with secret (+s) channels. Python 2.7+.
{"#chan": ["CheshireScrat", "Ichi", "Voren", "Anna", "GLaDOS", "Guy", "Swaps", "@Amaury", "Fanch"]}
@AmauryCarrade
AmauryCarrade / previous_message.diff
Last active September 13, 2016 11:40
Changes to display the last message of the previous page on FluxBB
diff --git a/style/Air.css b/style/Air.css
index 043112a..003d23b 100755
--- a/style/Air.css
+++ b/style/Air.css
@@ -1516,6 +1516,10 @@ html, body, .pun {
border-color: #dfe6ee;
}
+.pun .backpost .postbody, .pun .backpost .postfoot {
+ background: #f6f9fc;
@AmauryCarrade
AmauryCarrade / viewtopic.php.diff
Last active September 4, 2016 13:34
Changes to display ranks on FluxBB topics
diff --git a/viewtopic.php b/viewtopic.php
index 87f47b5..9b36032 100755
--- a/viewtopic.php
+++ b/viewtopic.php
@@ -194,6 +194,53 @@ require PUN_ROOT.'header.php';
<?php
+// ------ DISPLAYED RANKS ON THE FORUMS - CONFIG
+
@AmauryCarrade
AmauryCarrade / check_accounts.py
Last active March 4, 2016 17:44
Checks if Minecraft accounts in a list are still valid, to ban them from a server (as they can be hacked easily, if the data is from a leaked user/pass file). The rate limit is huge, like a request every two minutes.
import requests
import sys
import random
import csv
from time import sleep
rand = random.Random()
@AmauryCarrade
AmauryCarrade / tools-zcraft-netherrail.php
Last active March 2, 2016 00:28
Amélioration de l'outil de recherche d'itinéraire dans le Netherrail zcraftien de @FlorianCassayre. http://amaury.carrade.eu/tools/minecraft/zcraft/netherrail/
<?php
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
define('API_LIST', 'http://florian.cassayre.me/api/minecraft/netherrail-list');
define('API_ROUTE', 'http://florian.cassayre.me/api/minecraft/netherrail');
define('API_ROUTE_IMAGE', 'http://florian.cassayre.me/api/minecraft/netherrail-map');
define('MAIN_NETHERRAIL_STATIONS', 'nouvea,tentacles');
@AmauryCarrade
AmauryCarrade / yml2gettext.py
Created January 20, 2016 14:48
Converts YAML-based localization files to Gettext's PO format.
import fnmatch
import os
import yaml
import polib
from datetime import datetime
ref_locale = "en_US"
def flat_yaml(stream):
@AmauryCarrade
AmauryCarrade / injectTranslations.py
Created January 19, 2016 21:49
Translations injector for migration from key-based i18n to gettext (using the zDevelopers/zLib I18n component).
import fnmatch
import os
import yaml
def flat_yaml(stream):
with open(stream) as f:
raw_data = yaml.load(f)
data = {}
flatten_structure(raw_data, data)
@AmauryCarrade
AmauryCarrade / generator.php
Last active December 26, 2015 15:57
Bukkit permissions generator (published under the CeCILL-B licence)
<?php
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\Routing\Generator\UrlGenerator;
/* ** *** Plugin.yml generation *** ** */
@AmauryCarrade
AmauryCarrade / CalculusAntiSpam.php
Last active December 20, 2015 14:58
A calculation-based anti-spam for web forms, written in PHP. The documentation is available under the first file.
<?php
if(session_id() == '') {
session_start();
}
/**
* This class generates a calculation to prevent the spam on forms.
*
* @author Amaury Carrade
*/