Skip to content

Instantly share code, notes, and snippets.

Avatar
💻

Enrique Correa isseu

💻
View GitHub Profile
@isseu
isseu / dolar_chile.php
Created Dec 23, 2013
Código para obtener el precio del dolar desde la bolsa electrónica de santiago. Era para un mini-proyecto, no lo critiquen tanto
View dolar_chile.php
<?php
/**
* Código para obtener el precio del dolar desde la bolsa electrónica de santiago
*/
class BolsaElectronicaDolarAPI
{
private $dominio = "http://www.bolchile.cl";
private $url = "/portlets/Dolar2Portlet/XmlApiGraf?idioma=es&intervalo=60&periodo=HOY&mayorA10=true";
private $ultimos_cuanto = 30;
@isseu
isseu / crawler-ramos-uc.py
Last active Aug 29, 2015
Crawler sacar todos los ramos de la universidad catolica
View crawler-ramos-uc.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Credits isseu
import urllib2
import re
from titlecase import titlecase
import unicodedata
cursos = []
data = urllib2.urlopen("http://catalogo.uc.cl/index.php?Itemid=55").read().replace("\n", "")
View check_K_palindrome.rb
# Edit-Distance algorithm
def edit_distance_alg(string1, string2)
lenString1 = string1.length
lenString2 = string2.length
if([lenString1, lenString2].min == 0)
return [lenString1, lenString2].max
end
return [
edit_distance_alg(string1[0..-2], string2) + 1,
View Update Heroku Letsencrypt
./letsencrypt-auto certonly -d www.domain.com -d domain.com --manual
We put information in /public/.well-known/acme-challenge.
We update certs in Heroku
sudo heroku certs:update /etc/letsencrypt/live/domain.com/fullchain.pem /etc/letsencrypt/live/domain.com/privkey.pem
View CartPole-v0-TFLearn.py
from __future__ import division
import gym
import numpy as np
import tflearn
from tflearn.data_utils import to_categorical
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn import lstm, embedding
from tflearn.layers.estimator import regression
import random
from collections import deque
@isseu
isseu / SqueezeNet TFLearn.py
Created Jun 16, 2016
Only the construction part, squeezenet with tflearn
View SqueezeNet TFLearn.py
self.network = input_data(shape = [None, SIZE_FACE, SIZE_FACE, 1])
self.network = conv_2d(self.network, 96, 3, strides = 3, activation = 'relu')
self.network = max_pool_2d(self.network, 3, strides = 2)
# Fire 1
fire2_squeeze = conv_2d(self.network, 16, 1, activation = 'relu')
fire2_expand1 = conv_2d(fire2_squeeze, 64, 1, activation = 'relu')
fire2_expand2 = conv_2d(fire2_squeeze, 64, 3, activation = 'relu')
self.network = merge([fire2_expand1, fire2_expand2], mode = 'concat', axis = 1)
View CartPole-v0-Keras.py
from __future__ import division
import gym
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Activation
from keras.optimizers import sgd
import os
import random
from os.path import isfile
from collections import deque
@isseu
isseu / Bitbucket Pipeline Rails.yml
Created Dec 13, 2016
To run rails with bitbucket pipeline CI
View Bitbucket Pipeline Rails.yml
# This is a sample build configuration for Ruby.
# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: ruby:2.2.4
clone:
depth: 3
View feriados.csv
2011-01-01 Año Nuevo
2011-04-22 Viernes Santo
2011-04-23 Sábado Santo
2011-05-01 Día Nacional Del Trabajo
2011-05-21 Día De Las Glorias Navales
2011-05-31 Centenario De La Fundación De Puerto Natales
2011-06-27 San Pedro Y San Pablo
2011-07-16 Virgen Del Carmen
2011-08-15 Asunción De La Virgen
2011-08-20 Nacimiento Del Prócer De La Independencia