Skip to content

Instantly share code, notes, and snippets.

/* 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)
@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()
@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