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 / 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 / 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 / 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 / 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 / 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 / per-thread-search.diff
Last active December 26, 2016 23:59
Per-thread search for FluxBB
diff --git a/search.php b/search.php
index 28c4661..0822fd2 100755
--- a/search.php
+++ b/search.php
@@ -29,6 +29,7 @@ if (isset($_GET['action']) || isset($_GET['search_id']))
{
$action = (isset($_GET['action'])) ? $_GET['action'] : null;
$forum = (isset($_GET['forum'])) ? intval($_GET['forum']) : -1;
+ $topic = (isset($_GET['topic'])) ? intval($_GET['topic']) : -1;
$sort_dir = (isset($_GET['sort_dir']) && $_GET['sort_dir'] == 'DESC') ? 'DESC' : 'ASC';
@AmauryCarrade
AmauryCarrade / fluxbb-to-bcrypt.diff
Last active March 24, 2017 10:38
Migration de FluxBB vers BCrypt
diff --git a/include/common.php b/include/common.php
index 1661f58..3af340a 100644
--- a/include/common.php
+++ b/include/common.php
@@ -45,6 +45,16 @@ if (!defined('PUN'))
exit;
}
+// If the password config is missing, here are some default values
+if (!isset($password_hash_options) || empty($password_hash_options))
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
requests = "*"
beautifulsoup4 = "*"