Skip to content

Instantly share code, notes, and snippets.

@jgcasta
jgcasta / license-badges.md
Created June 1, 2016 07:26 — forked from lukas-h/license-badges.md
License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file. Easily copy and paste the code under the badges into your Markdown files.

Apache

Apache 2.0 License

License
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

BSD

@jgcasta
jgcasta / ShellDeleteOracleRecords.sh
Last active January 2, 2016 16:39
Delete Oracle records from a bash shell script
#!/bin/bash
#Delete Oracle table since 1 natural year
#
ANO=$(date +%Y)
ANTERIOR=$[ANO-1]
FBORRADO=$(date +%d-%m-$ANTERIOR)
MES=$(date +%m)
MESANTERIOR=$[MES-1]
@jgcasta
jgcasta / MavenCheatSheet.txt
Created May 11, 2013 20:18
Maven Cheat Sheet
Install an external dependency into the local repository
$ mvn install:install-file -Dfile=<path-to-file> -DgroupId=Id=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
Generate a package
$ mvn package
Install into the local repository
@jgcasta
jgcasta / date2XMLGregorianCalendar.java
Last active December 16, 2015 21:39
Return a XMLGregorianCalendar from a Date object in java
public static XMLGregorianCalendar date2XMLGregorianCalendar(Date fecha, Date hora) {
Calendar calendarFecha = Calendar.getInstance();
calendarFecha.setTime(fecha);
Calendar calendarHora = Calendar.getInstance();
calendarHora.setTime(hora);
//System.out.println("hora->" + calendarHora.get(Calendar.HOUR_OF_DAY) + "/" + calendarHora.get(Calendar.MINUTE) + "/" +calendarHora.get(Calendar.SECOND));
@jgcasta
jgcasta / AddCentos5Repositories
Created March 16, 2013 11:51
Add and update EPEL and RPMFusion repositories in a CentOS 5
#!/bin/bash
# Add and update EPEL and RPMFusion repositories in a CentOS 5
# jgcasta at gmail dot com
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm -import RPM-GPG-KEY.dag.txt
rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -ivh http://mirror.chpc.utah.edu/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
@jgcasta
jgcasta / DeleteOracle
Created February 22, 2013 11:50
Delete oracle old entries shell script
#!/bin/bash
# Delete 1 year before today
#
# 20/02/2013 v1.0
#
#
ANO=$(date +%Y)
@jgcasta
jgcasta / AnalemaMadrid
Created February 21, 2013 23:05
Plot an Analema visible from Madrid
#!/usr/bin/python
"""
Traza la Analema para un Madrid
@precondition: se necesita tener el paquete Ephem
"""
import ephem
@jgcasta
jgcasta / plotHistogram
Last active December 12, 2015 09:09
Plot histogram data
#! /usr/bin/env python
# -*- coding: utf-8
"""
Plot histogram
version 1.0
autor José Gómez Castaño
email jgcasta@gmail.com