Skip to content

Instantly share code, notes, and snippets.

@vfrico
vfrico / extractttf.py
Last active August 29, 2015 14:08
extractttf.py
#!/usr/bin/env python3
# *-* coding: UTF-8 *-*
#
# ** extractttf.py **
# Programa que extrae archivos ttf de carpeta con otros archivos
#
# Copyright 2012-2015 Víctor Fernández Rico <vfrico@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@vfrico
vfrico / randoms.py
Created October 31, 2015 10:29
Crear números aleatorios en Python
#!/usr/bin/env python3
RANDBYTES = 280 #Número de Bytes aleatorios que tendrá de longitud
NUM = 1000 #Cantidad de números a sacar
import os
dist = open("randoms.txt",'w+')
for i in range(0,NUM):
ran = int.from_bytes(os.urandom(RANDBYTES), byteorder='little')
#dist.write(hex(ran) + "\n") #Imprime los números en hexadecimal
dist.write(str(ran) + "\n") #Imprime los números en decimal
dist.close()
/* Based on a tweet from @joselucross (https://twitter.com/joselucross/status/694487120182837248)
Generates a triangle on ASCII
*/
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
void triangulo (int n)
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define MAXIMO 15
int main(){
int t, total;
char text[MAXIMO];
total = 0;
printf("Introduce un texto: \n");

Keybase proof

I hereby claim:

  • I am vfrico on github.
  • I am vfrico (https://keybase.io/vfrico) on keybase.
  • I have a public key ASCrjyfbDwgtMe5Fg9OohCI6aXskZxNFUZL1u2CMxxQCAAo

To claim this, I am signing this object:

#!/usr/bin/env python3
class UnaClase():
def __init__(self):
self.atributo1 = 1
self.atributo2 = 2
lista = []
for i in range(0,10):
uc = UnaClase()
docker pull recognai/jupyter-scipy-kge
git clone https://github.com/vfrico/kge-wikidata
docker run -d -p 8888:8888 -v $PWD/kge-wikidata:/home/jovyan/work recognai/jupyter-scipy-kge
@vfrico
vfrico / Dockerfile
Created October 18, 2016 11:36
Dockerfile for vfrico/kge-server
FROM jupyter/scipy-notebook
MAINTAINER Daniel Vila Suero <dvilasuero@gmail.com>
MAINTAINER Víctor Fernández Rico <vfrico@gmail.com>
USER root
# install scikit-kge from github
#RUN git clone https://github.com/vfrico/scikit-kge.git
RUN git clone https://github.com/vfrico/kge-server.git
@vfrico
vfrico / rename_images_to_list.py
Created March 15, 2017 18:14
Reorder images by EXIF date under same prefix
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# coding:utf-8
#
# rename_images_to_list.py: Reorder images by EXIF date under same prefix
# Copyright (C) 2017 Víctor Fernández Rico <vfrico@gmail.com>
#
# Thanks to Denis Barmenkov <denis.barmenkov@gmail.com>, for the original idea
# https://code.activestate.com/recipes/576646-exif-date-based-jpeg-files
# -rename-using-pil/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Parametrizador MEL cepstrum
% Par�metros:
% Nombre del fichero de entrada: n_fichero
% Longitud de la ventana: l_v
% Desplazamiento: desplaza
% N�mero de bandas: n_bandas
% Filtrado de preenfasis: preen
% Salida gr�fica: dibuja
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%