Skip to content

Instantly share code, notes, and snippets.

View Ereza's full-sized avatar

Eduard Ereza Martínez Ereza

View GitHub Profile
@Ereza
Ereza / nightcorizer.sh
Created December 17, 2016 15:24
Nightcorizer script (sox+ffmpeg)
#!/bin/bash
if [ $# -ne 6 ]
then
echo "Usage: $0 input_audio background_image text_to_display speed spectrum_color output_video"
echo "Example: $0 \"My song.mp3\" \"My background image.jpg\" \"Artist - Song\" 1.27 FFFFFF \"Output video.mp4\""
exit 1
fi
ffmpeg -i "$1" _temp.wav
sox _temp.wav _temp_speedup.wav speed $4
@Ereza
Ereza / submit_post.php
Last active June 15, 2024 05:23
Sample script to add a new post to a phpBB forum as a specific user
<?php
define('IN_PHPBB', true);
$phpbb_root_path = '../forum/';
$phpEx = substr(strrchr(__FILE__, '.') , 1);
include ($phpbb_root_path . 'common.' . $phpEx);
include ($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
$user_id = 755;
$forum_id = 32;
$subject = 'Missatge de prova';
@Ereza
Ereza / .htaccess
Last active May 14, 2017 23:30
htaccess for seourls
RewriteRule ^(.*)-t([0-9]*)-([0-9]*).html viewtopic.php?t=$2&start=$3&%{QUERY_STRING} [L]
RewriteRule ^(.*)-t([0-9]*).html viewtopic.php?t=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-f([0-9]*)-([0-9]*).html viewforum.php?f=$2&start=$3&%{QUERY_STRING} [L]
RewriteRule ^(.*)-f([0-9]*).html viewforum.php?f=$2&%{QUERY_STRING} [L]
@Ereza
Ereza / EmojiHandler.java
Created May 30, 2017 18:36
EmojiHandler optimized with regex
package com.vanniktech.emoji;
import android.content.Context;
import android.text.Spannable;
import com.vanniktech.emoji.emoji.Emoji;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Ereza
Ereza / MainActivity.java
Created May 30, 2017 21:04
EmojiTextView test
package cat.ereza.testemoji;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.TextView;
import com.vanniktech.emoji.EmojiManager;
import com.vanniktech.emoji.one.EmojiOneProvider;
@Ereza
Ereza / download_full_site.sh
Last active July 20, 2017 17:50
Download full site with wget
#Adjust --level as needed (max recursive depth)
#For rate-limited sites (random wait between 10 and 20 s)
wget -w 10 --random-wait -e robots=off --recursive --level 30 --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains mydomain.com --no-parent http://mydomain.com/path/
#For own sites with no limit:
wget -e robots=off --recursive --level 30 --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains mydomain.com --no-parent http://mydomain.com/path/
-- Efecte d'aparició i desaparició i degradat central
-- Aplica un efecte d'aparició i desaparició i degradat central a cada caràcter
local tr = aegisub.gettext
script_name = "Efecte d'aparició i desaparició i degradat central"
script_description = "Aplica un efecte d'aparició i desaparició i degradat central a cada caràcter"
script_author = "Ereza"
script_version = "1"
@Ereza
Ereza / zelda3_weblate_preview.user.js
Last active March 5, 2020 21:20
Zelda3 preview in Weblate for TamperMonkey
// ==UserScript==
// @name The Legend of Zelda: A Link to the Past preview for Weblate
// @namespace https://traduccions.ereza.cat/
// @version 0.0.2
// @description The Legend of Zelda: A Link to the Past preview for Weblate
// @author Eduard Ereza Martínez
// @match https://weblate.ereza.cat/translate/the-legend-of-zelda-a-link-to-the-past/textos/*/*
// @grant GM_addStyle
// ==/UserScript==
@Ereza
Ereza / chronotrigger_weblate_preview.user.js
Last active March 9, 2020 01:30
Chrono Trigger preview in Weblate for TamperMonkey
// ==UserScript==
// @name Chrono Trigger preview for Weblate
// @namespace https://traduccions.ereza.cat/
// @version 0.0.1
// @description Chrono Trigger preview for Weblate
// @author Eduard Ereza Martínez
// @match https://weblate.ereza.cat/translate/chrono-trigger/textos/*/*
// @grant GM_addStyle
// ==/UserScript==
@Ereza
Ereza / export.sh
Last active March 26, 2020 10:05
Werewolf for Telegram export/import to CSV for Weblate
#!/bin/bash
insidecomment=0
insidevalue=0
insidedeprecated=0
while IFS= read -r line
do
case "$line" in
*\<\?xml*)