Skip to content

Instantly share code, notes, and snippets.

Fernando Vicente fvicente

Block or report user

Report or block fvicente

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
fvicente /
Created Dec 18, 2017
Dictionary of most used language by country based on
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import xml.etree.ElementTree as etree
import urllib
import pprint
def get_most_used_language_by_territory():
langxml = urllib.urlopen('')
langtree = etree.XML(
fvicente /
Last active Dec 18, 2017
Minecraft server world selector

Minecraft Server World Selector

This a very simple user interface that automatically edits the file, but it does not restarts the server.

Made in python 2.7 with pyside2. Using miniconda instead of venv, because pyside2 is not available through pip at this time.


  • Copy to your minecraft server directory.
fvicente / rgb_opacity.js
Last active Aug 5, 2017
RGB opacity calculator
View rgb_opacity.js
function colorHexToRGB(htmlColor) {
var COLOR_REGEX = /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/;
var arrRGB = htmlColor.match(COLOR_REGEX);
if (arrRGB === null) {
alert("Invalid color passed, the color should be in the html format. Example: #ff0033");
return null;
var red = parseInt(arrRGB[1], 16);
var green = parseInt(arrRGB[2], 16);
var blue = parseInt(arrRGB[3], 16);
fvicente /
Created Mar 31, 2017
When you are creating an XML with ElementTree but you want to manipulate all the values of text nodes
# -*- coding: utf-8 -*-
import xml.etree.ElementTree as et
class OverloadedElement(et.Element):
def __setattr__(self, name, value):
if name == "text":
value = value.replace(u'ú', 'u')
value = value.replace(u'ô', 'o')
fvicente /
Created Feb 22, 2016
Extracting FLV meta tags with Python
from struct import unpack
from datetime import datetime
class FLVReader(dict):
Reads metadata from FLV files
# Tag types
fvicente /
Created Sep 13, 2015
Sony Entertainment Network spam stopper
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import urllib
import urllib2
import datetime
import sys
import time
fvicente / joystick.ino
Created Sep 13, 2015
Arcade Joystick with Teensy 3.0
View joystick.ino
/* Arcade Keyboard-Joystick */
#include <usb_keyboard.h>
#define NUM_BUTTONS 8
int mask = 0;
int i = 0;
void setup() {
fvicente / compress.iss
Last active Jun 8, 2018
Compress a directory in inno setup
View compress.iss
function MakeBackup(indir, outfile: String): Boolean;
res: Boolean;
fso: Variant;
winShell: Variant;
f: Variant;
inObj: Variant;
outObj: Variant;
res := FALSE;
fvicente /
Last active Sep 13, 2015
Denise’s birthday problem solution (in Python)
# -*- coding: utf-8 -*-
from collections import defaultdict
# (dd, mmm, yyyy)
dates = [
(17, "Feb", 2001),
(13, "Mar", 2001),
(13, "Apr", 2001),
(15, "May", 2001),
(17, "Jun", 2001),
You can’t perform that action at this time.