Skip to content

Instantly share code, notes, and snippets.

Avatar

Eduard Ereza Martínez Ereza

View GitHub Profile
@Ereza
Ereza / export.sh
Last active Mar 26, 2020
Werewolf for Telegram export/import to CSV for Weblate
View export.sh
#!/bin/bash
insidecomment=0
insidevalue=0
insidedeprecated=0
while IFS= read -r line
do
case "$line" in
*\<\?xml*)
@Ereza
Ereza / chronotrigger_weblate_preview.user.js
Last active Mar 9, 2020
Chrono Trigger preview in Weblate for TamperMonkey
View chronotrigger_weblate_preview.user.js
// ==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 / zelda3_weblate_preview.user.js
Last active Mar 5, 2020
Zelda3 preview in Weblate for TamperMonkey
View zelda3_weblate_preview.user.js
// ==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==
View macro_aparicio.lua
-- 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 / download_full_site.sh
Last active Jul 20, 2017
Download full site with wget
View download_full_site.sh
#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/
@Ereza
Ereza / MainActivity.java
Created May 30, 2017
EmojiTextView test
View MainActivity.java
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 / EmojiHandler.java
Created May 30, 2017
EmojiHandler optimized with regex
View EmojiHandler.java
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 / .htaccess
Last active May 14, 2017
htaccess for seourls
View .htaccess
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 / submit_post.php
Last active May 30, 2020
Sample script to add a new post to a phpBB forum as a specific user
View submit_post.php
<?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 / nightcorizer.sh
Created Dec 17, 2016
Nightcorizer script (sox+ffmpeg)
View nightcorizer.sh
#!/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
You can’t perform that action at this time.