Skip to content

Instantly share code, notes, and snippets.

View GasparCorrea's full-sized avatar

Gaspar Octavio GasparCorrea

View GitHub Profile
#!/bin/bash
mkdir $1
cd ./$1
touch "$1.cpp"
echo "$1: $1.cpp" > makefile
echo " g++ $1.cpp -o $1" >> makefile
echo '#include <iostream>' >> $1.cpp
echo '' >> $1.cpp
echo 'using namespace std;' >> $1.cpp
echo '' >> $1.cpp
@GasparCorrea
GasparCorrea / huffman.py
Created October 31, 2017 17:56
Implementación del código Huffman en Python
#!/usr/bin/env python3
from collections import Counter
import json
import pickle
import sys
import argparse
class Tree(object):
def __init__(self,left,right,data):
self.left = left
@GasparCorrea
GasparCorrea / .block
Last active September 13, 2019 13:36
Shoegaze Map
height: 1000
border: yes
#!/usr/bin/env python
import subprocess
import os
def update_bookmark(dir,number):
with open(dir+"/.bookmark",'w') as f:
f.write(number)
def read_bookmark(dir):
if not os.path.isfile(dir+"/.bookmark"):
@GasparCorrea
GasparCorrea / App.js
Created January 10, 2019 16:37
Anitime
var request = new XMLHttpRequest();
function get_time(duration){
console.log(duration);
let total = 0;
if (duration.includes(" min per ep") ){
total = parseInt(duration.replace(" min. per ep.",""), 10);
console.log("yes");
}
return total;
@GasparCorrea
GasparCorrea / .block
Last active January 10, 2019 16:41
Anitime
height: 1000
border: yes