Skip to content

Instantly share code, notes, and snippets.

View FdelMazo's full-sized avatar
🤹‍♂️
Juggling commits

Federico del Mazo FdelMazo

🤹‍♂️
Juggling commits
View GitHub Profile
@FdelMazo
FdelMazo / Makefile
Last active November 6, 2018 15:24
EXEC = $(shell basename $(CURDIR))
CFILES = $(wildcard *.c)
HFILES = $(wildcard *.h)
#OFILES = $(patsubst %.c, %.o, $(filter-out $(CFILES), $(wildcard *.c)))
CC = gcc
CFLAGS = -g -std=c99 -Wall -Werror
CFLAGS += -Wconversion -Wno-sign-conversion -Wbad-function-cast -Wshadow
CFLAGS += -Wno-unused-function #Solo para comodidad en pruebas locales
CFLAGS += -Wtype-limits -pedantic
@FdelMazo
FdelMazo / JL8.py
Last active April 21, 2018 20:30
JL8 comics downloader
import requests, zipfile
from bs4 import BeautifulSoup
soup = BeautifulSoup(requests.get("http://limbero.org/jl8").content, "lxml")
latest_issue = int(soup.title.string.split(' ')[0][1:])
FIRST = 0
LAST = latest_issue
COVER = 'http://static.tvtropes.org/pmwiki/pub/images/rsz_tumblr_or2whrxrgs1r7ni1io1_1280.jpg'
@FdelMazo
FdelMazo / CountingSort.py
Last active May 5, 2018 19:11
Counting Sort Estable: Ordenar una lista de enteros con colores asignados
from termcolor import colored #pip install termcolor
import random, re
COLORS = ["green", "blue", "red", "yellow", "magenta", "cyan"]
ANSI_ESCAPE = re.compile(r'\x1b[^m]*m')
"""Utilizacion:
Desde la terminal de Python: from CountingSort import counting_sort
counting_sort([1,2,3])
Procede a colorear la lista de enteros y luego ordenarla. El color sirve para mostrar la estabilidad del ordenamiento.
@FdelMazo
FdelMazo / 6107.ipynb
Last active March 19, 2024 19:57
6107-Discreta: Demostraciones de teoría de grafos
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FdelMazo
FdelMazo / fake_malloc.c
Last active August 1, 2018 13:42
Emulador de falsos mallocs. Un wrapper para poder variar entre un malloc normal y uno que devuelva solo NULL
#include "fake_malloc.h"
bool trucho = false;
int MALLOC_TRUCHO(void) { return trucho; }
void *malloc(size_t size) {
if (MALLOC_TRUCHO()) return NULL;
static void * (*func)();
if(!func) func = (void *(*)()) dlsym(RTLD_NEXT, "malloc");
return(func(size));
@FdelMazo
FdelMazo / errores_valgrind.c
Last active September 1, 2019 17:56
Ejemplo de los errores mas típicos en Valgrind
#include <stdio.h>
#include <stdlib.h>
/*
Compilacion:
gcc -g errores_tipicos.c -o errores
* g: Compila con información de debugging, para que programas como Valgrind y GDB vean bien donde estan los errores, entre otras cosas.
Corrida:
./errores
Chequeo de perdida de memoria:
@FdelMazo
FdelMazo / TallerProgramacionDinamica.ipynb
Last active October 10, 2019 15:45
Programación Dinámica: or How I Learned to Stop Worrying and Love the Recurrencia
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FdelMazo
FdelMazo / 6203.pdf
Last active March 8, 2024 12:45
6203-Física2: El apunte de Física II de FIUBA, pero con el índice y los links internos correctos
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FdelMazo
FdelMazo / tmdbdump_to_csv.py
Last active October 30, 2019 19:16 — forked from galli-leo/tmdbdump.py
Converting the entire TMDB database's jsons to a single csv. Usage: ./tmdbdump_to_csv.py && ./tmdbdump_to_csv_merge.sh
#!/usr/bin/env python
# 1. Download TMDB's database with @galli-leo's script
# https://gist.github.com/galli-leo/6398f9128ffc20af70c6c7eedfeb0a65
# 2. Run python3 tmdbdump_to_csv.py
import pandas as pd
import numpy as np
import json
import os
@FdelMazo
FdelMazo / $IMDBtoCSV.md
Last active March 5, 2020 03:54
IMDBtoCSV: Converts IMDB data sets in plain text to a simple CSV

Como usar

  1. Descargar y descomprimir el ultimo set de datos proporcionado por IMDB aca:
  • actors.list.gz: ftp://ftp.funet.fi/pub/mirrors/ftp.imdb.com/pub/frozendata/actors.list.gz
  • actresses.list.gz: ftp://ftp.funet.fi/pub/mirrors/ftp.imdb.com/pub/frozendata/actresses.list.gz
  1. Llamar con: python imdbtocsv.py actresses.list actors.list o cada uno por separado

En imdbtocsv.py se puede leer un pequeño paso a paso de como se parsea el archivo