Skip to content

Instantly share code, notes, and snippets.

@geopelia
geopelia / README.md
Created June 21, 2019 00:23
SCRIPT-8
@geopelia
geopelia / procesarFecha.py
Created May 25, 2019 19:57
Extrae las fechas de un archivo, extrae dias de la semana y hora, muestra un grafico con el resumen de ocurrencias
import datetime
import dateutil.parser
import matplotlib.pyplot as plt
import calendar
def leer_archivo():
#lista_fechas = []
with open('fechasgit.txt', 'r') as archivotxt:
#print('open file')
#cant_lineas = 0
@geopelia
geopelia / cargarNombres.py
Created August 23, 2018 19:22
Devuelve una tupla de nombres masculino y femenino, y apellidos al azar de una lista
# -*- coding: utf-8 -*-
import random
import sys
nombresMaculinos=["Santiago","Mateo","Sebastián","Alejandro","Matías","Diego","Samuel","Nicolás","Daniel","Martín","Benjamín","Emiliano ","Leonardo","Joaquín","Lucas","Iker","Gabriel","Thiago","Adrián","Bruno","Dylan","Tomás","David","Agustín","Ian","Ethan","Felipe","Maximiliano","Eric","Hugo","Pablo","Lucas","Rodrigo","Ignacio","Simón","Carlos","Javier","Juan Pablo","Isaac","Santino","Manuel","Jerónimo","Emmanuel","Aarón","Ángel","Dante","Gael","Vicente","Juan Sebastián","Liam","Damián","Leo","Francisco","Alonso","Christopher","Álvaro","Bautista","Miguel Ángel","Valentino","Rafael","Andrés","Franco","Fernando","León","Oliver","Emilio","Marcos","Julián","Juan José","Pedro","Alexander","Lorenzo","Mario","Sergio","Máximo","Cristian","Esteban","Elías","Antonio","Luciano","Noah","Jorge","Enzo","Axel","Salvador","Marc","Derek","Juan Martín","Joel","Juan Diego","Gonzalo","Kevin","Alan ","Eduardo","Miguel","Iván","Josué","Cristóbal","Ciro","Juan David"]
nombresFemeni
@geopelia
geopelia / cambiarplaca.py
Created May 19, 2018 01:09
Ejemplo para leer un archivo de excel en python, cambiar los valores de una columan especifica usando un patron y correlativo y luego imprimir los valores generados y salvar el archivo con los cambios
# -*- coding: utf-8 -*-
import openpyxl
import sys
first_row=3
last_row=10
filename='Prueba.xlsx'
placa_name='B'
serial_name='H'
chasis_name='J'
@geopelia
geopelia / .vimrc
Last active August 26, 2018 20:45
mi vimrc
set nocompatible " choose no compatibility with legacy vi
syntax enable
"" Vundle plugin
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
@geopelia
geopelia / acsedeploy.sh
Last active November 22, 2016 02:32
Lista proyectos que están en determinadas rutas y ejecuta una acción determinada
#!/bin/bash
path=/home/pi
action=$1
num_folder=$2
project_sufix="/scm/Deploy_EAR/wee"
is_folder_exist() {
[[ -d $1 ]] && return 0 || return 1
}
@geopelia
geopelia / package.json
Created October 29, 2016 16:58
Ejemplo para crear tablas en Sqlite y conectarme desde nodejs
{
"name": "prueba-sqlite",
"description": "Pruebas con SQlite",
"version": "0.0.1",
"dependencies": {
"sqlite3": "3.x"
}
}
@geopelia
geopelia / curl login
Created October 26, 2016 20:41
download file after login in using curl
curl 'http://example.com/forum/login.php' -H 'Host: example.com' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: http://example.com/forum/login.php' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' --data 'name=user&pass=passs&back=%2F' -c "cookies.txt"
curl -O 'http://example.com/download/user/d61bdf7e2e/11724.mp3' -H 'Host: example.com' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: http://example.com/amusic/' -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' --data '' -b cookies.txt
@geopelia
geopelia / 11.html
Last active April 28, 2016 16:32
Extraer info de página html a un formato markdown
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css; charset=UTF-8" />
<meta http-equiv="content-script-type" content="text/javascript" />
<title>ACE COMBAT 3 FANSITE – AWAKENING</title>
<link rel="start" href="http://www28.atwiki.jp/acacac/" />
<link rel="stylesheet" type="text/css" href="http://www28.atwiki.jp/_skin/base_025zilla.css?" media="all" />
@geopelia
geopelia / search_images.js
Created August 6, 2015 15:20
Read a folder for images saves in array and write in another js file
var fs = require('fs'),
path = require('path');
var p = "../img";
fs.readdir(p, function (err, files) {
if (err) {
throw err;
}
var extList = [".jpg", ".gif", ".png"];
var images = files.map(function (file) {