Skip to content

Instantly share code, notes, and snippets.

View fransafu's full-sized avatar
🎯
Keep it simple

Francisco Javier Sánchez Fuentes fransafu

🎯
Keep it simple
View GitHub Profile
@fransafu
fransafu / Web_scraping_informeperros.py
Created February 25, 2018 17:52
Web scraping of site web informeperros.com
# -*- coding: utf-8 -*-
from pprint import pprint
from bs4 import BeautifulSoup
import requests
import json
URL = 'http://informeperros.com/lista-de-todas-las-razas-de-perros-por-orden-alfabetico/'
def main():
#Actualiza repositorio
sudo apt-get update
# instala build-essential y libssl
sudo apt-get install build-essential libssl-dev
# Descarga script de instalacion de Node Version Manager
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh
# Ejecuta script de instalacion de NVM
@fransafu
fransafu / Bubble Sort
Created January 12, 2016 19:36
Bubble Sort in PHP
function bubbleSort($array){
$lenArray = count($array);
for($i = 1; $i <= $lenArray; $i++){
for($j = 0; $j < $lenArray; $j++){
if (($j + 1) < $lenArray){
if ($array[$j] > $array[$j + 1]){
$aux = $array[$j];
$array[$j] = $array[$j + 1];
$array[$j + 1] = $aux;
@fransafu
fransafu / The Dijkstra algorithm
Created January 12, 2016 16:57
This is the Dijkstra algorithm in python 3
def dijkstra(matriz_costo, numero_vertices):
S = [1] # Vertices visitados, iniciamos con 1
V = list(range(1,numero_vertices+1)) # Vertices disponibles
D = [0] * numero_vertices # Arreglo de costo
print ('\n[+] Inicializando variables.')
print ('Vertice inicial visitado S:' + str(S))
print ('Vertices disponibles en total V:' + str(V))
print ('Arreglo de costo inicializado D:' + str(D))
print ('')
francisco@Francisco-NB:~/ProyectoGit/PHPLaravelGymManagementSystem$ sudo php artisan migrate
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0
Migration table created successfully.
[Exception]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'migrations' already exists (SQL: create table `migrations` (`id` int unsigned not
null auto_increment primary key, `migration` varchar(255) not null, `batch` int not null, `created_at` timestamp default 0 not null, `updated_at
` timestamp default 0 not null) default character set utf8 collate utf8_unicode_ci) (Bindings: array (