Skip to content

Instantly share code, notes, and snippets.

View jorge-lavin's full-sized avatar
🏠
Working from home

Jorge Lavin jorge-lavin

🏠
Working from home
View GitHub Profile
@jorge-lavin
jorge-lavin / get_oracle_jdk_linux_x64.sh
Last active January 16, 2018 07:42 — forked from n0ts/get_oracle_jdk_x64.sh
Get latest Oracle JDK package bash shell script
#!/bin/bash
# You must accept the Oracle Binary Code License
# http://www.oracle.com/technetwork/java/javase/terms/license/index.html
# usage: get_jdk.sh <jdk_version> <ext>
# jdk_version: 8(default) or 9
# ext: rpm or tar.gz
jdk_version=${1:-8}
ext=${2:-rpm}
@jorge-lavin
jorge-lavin / .vimrc
Last active November 22, 2016 23:40
vimrc
" Set marker as fold method
" vim:fdm=marker
" Prepare Vundle {{{
set nocompatible " be iMproved
filetype off " must be off before Vundle has run
" Bootstrap Vundle, as seen in krisleech/turbo-vim
if !isdirectory(expand("~/.vim/bundle/Vundle.vim/.git"))
!git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
@jorge-lavin
jorge-lavin / prototypes.js
Created January 20, 2016 09:13
Javascript prototypes
// Prototype demonstration
function Salutator(name) {
if (name === undefined){
throw "Please specify a name for Salutator";
} else {
this.name = name;
}
}
@jorge-lavin
jorge-lavin / nif.py
Last active January 19, 2016 10:54
Calcular Letra de Nif
# Fuente
# https://es.wikibooks.org/wiki/Algoritmo_para_obtener_la_letra_del_NIF#Python
def get_nif_letter(nif_numbers):
try:
return ("T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E")[nif_numbers%23]
except TypeError as e:
print(e)
print('Maybe you should pass the argument as a number')
raise
import os
import logging_manager # Fix this
# Get script file name without extension
SCRIPT_FILE_NAME=os.path.splitext(os.path.basename(__file__))[0]
#TODO: dot log is only added if used init_logger.
# Define the log filename
ROTATING_LOG_FILE_NAME = SCRIPT_FILE_NAME + '.log'
#Define the warning log filename
WARNING_LOG_FILE_NAME = SCRIPT_FILE_NAME + '_warning' + '.log'
import http.client
import ssl
root_url='jira.ci.gsnet.corp'
children_url='secure/Dashboard.jspa'
protocol=ssl.PROTOCOL_TLSv1
context=ssl.SSLContext(protocol)
context.verify_mode=ssl.CERT_NONE
conn = http.client.HTTPSConnection(root_url, context=context)
"""
Parser for amazon appliances data
"""
#TODO: Remove trailing '\n' in entries
import pprint
import sys
FILE_NAME='maestroparseador.txt'
#
# .zshrc is sourced in interactive shells.
# It should contain commands to set up aliases,
# functions, options, key bindings, etc.
#
autoload -U compinit
compinit
#allow tab completion in the middle of a word
" Set folding method to be marker for this file
" vim:fdm=marker
" Vundle {{{
" Prepare to install Vundle if needed
let vundle_installed=1 " Assume Vundle is not to be installed
let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
if !filereadable(vundle_readme)
echo "Installing Vundle.."
echo ""
@jorge-lavin
jorge-lavin / colours.sh
Created March 19, 2015 08:25
Shell colour codes
RCol='\e[0m' # Text Reset
# Regular Bold Underline High Intensity BoldHigh Intens Background High Intensity Backgrounds
Bla='\e[0;30m'; BBla='\e[1;30m'; UBla='\e[4;30m'; IBla='\e[0;90m'; BIBla='\e[1;90m'; On_Bla='\e[40m'; On_IBla='\e[0;100m';
Red='\e[0;31m'; BRed='\e[1;31m'; URed='\e[4;31m'; IRed='\e[0;91m'; BIRed='\e[1;91m'; On_Red='\e[41m'; On_IRed='\e[0;101m';
Gre='\e[0;32m'; BGre='\e[1;32m'; UGre='\e[4;32m'; IGre='\e[0;92m'; BIGre='\e[1;92m'; On_Gre='\e[42m'; On_IGre='\e[0;102m';
Yel='\e[0;33m'; BYel='\e[1;33m'; UYel='\e[4;33m'; IYel='\e[0;93m'; BIYel='\e[1;93m'; On_Yel='\e[43m'; On_IYel='\e[0;103m';
Blu='\e[0;34m'; BBlu='\e[1;34m'; UBlu='\e[4;34m'; IBlu='\e[0;94m'; BIBlu='\e[1;94m'; On_Blu='\e[44m'; On_IBlu='\e[0;104m';
Pur='\e[0;35m'; BPur='\e[1;35m'; UPur='\e[4;35m'; IPur='\e[0;95m'; BIPur='\e[1;95m'; On_Pur='\e[45m'; On_IPur='\e[0;105m';
C