Skip to content

Instantly share code, notes, and snippets.

View aVolpe's full-sized avatar
:electron:
Hacking

Arturo Volpe aVolpe

:electron:
Hacking
View GitHub Profile
@aVolpe
aVolpe / test.py
Created January 25, 2016 19:54
Ejemplo de scraping con python para curso de open data
import urllib2
from bs4 import BeautifulSoup
e = urllib2.urlopen("http://es.wikipedia.org/wiki/Paraguay").read()
soup = BeautifulSoup(e, 'html.parser')
# Ejemplo de como imprimir todo
# print soup.prettify()
@aVolpe
aVolpe / TestCounter.java
Created April 20, 2016 22:18
Desafio Owl
package test;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
public class TestCounter {
public static void main(String[] args) {
@aVolpe
aVolpe / DigitGenerator.js
Last active November 28, 2016 14:10
Obtener el dígito verificador de la Secretaria de Estado de Tribulación del Paraguay
export default class DigitGenerator {
getDigitoVerificadorBase11 = (ruc) => {
return this.getDigitoVerificador(ruc, 11);
}
getDigitoVerificador = (ruc, base) => {
var k = 2;
@aVolpe
aVolpe / RegisterServicesTest.java
Last active December 1, 2016 07:43
RegisterServicesTest.java
@ContextConfiguration(loader = AnnotationConfigContextLoader.class)
public class RegisterServicesTest extends BaseTest {
@Configuration
static class ContextConfiguration extends BaseTestConfiguration {
@Bean
public ServiceDefinitionRegister serviceDefinitionRegister() {
return new ServiceDefinitionRegister();
@aVolpe
aVolpe / datasource.xml
Created September 12, 2014 19:31
Jboss sample informix datasource
<datasource jta="true" jndi-name="java:jboss/datasources/CopacoBillingDS" pool-name="CopacoBillingDS" enabled="true" use-ccm="true">
<connection-url>jdbc:informix-sqli://10.13.200.41:9088/copaco_prueba01:informixserver=copacodb</connection-url>
<driver>informix-jdbc</driver>
<security>
<user-name>USER</user-name>
<password>PASS</password>
</security>
</datasource>
@aVolpe
aVolpe / AuditCallback.java
Last active August 25, 2017 06:40
Audit with flyway and postgresql
package test;
import java.sql.Connection;
import org.flywaydb.core.api.MigrationInfo;
import org.flywaydb.core.api.callback.FlywayCallback;
public class AuditCallback implements FlywayCallback {
@Override
@aVolpe
aVolpe / create_all.sh
Created November 20, 2017 16:56
Push a folder full of git repositories to a new created projects in gitlab
#!bin/bash
#set -x
for i in $(find $1 -type d -maxdepth 1);
do
NAME=`basename $i | sed -e 's/[a-z]*_//'`;
# Excluimos la carpeta principal
if [ "$NAME" == "repos" ]
then
continue # Skip rest of this particular loop iteration.
@aVolpe
aVolpe / Dockerfile
Last active December 17, 2017 18:03
A example dockerfile to use pgFouine with postgresql 9.4
FROM postgres:9.4
MAINTAINER Arturo Volpe <arturovolpe@gmail.com>
ENV DB_NAME test
ENV DB_USER admin
ENV DB_PASS password
RUN apt-get update && apt-get install -y wget && wget --no-check-certificate --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
RUN apt-get update && apt-get install -y postgresql-9.3-postgis-2.1 -f
ADD setup-database.sh /docker-entrypoint-initdb.d/ # this scripts creates a database, is optional
@aVolpe
aVolpe / CameraGestures.cs
Created March 31, 2014 20:46
A simple script that manipulates the camera through TouchScript to move it around a object. (Can zoom and rotate too).
using System;
using TouchScript.Events;
using TouchScript.Gestures;
using TouchScript.Gestures.Simple;
using UnityEngine;
public class CameraGestures : MonoBehaviour {
public float Speed = 10f;
public float PanSpeed = 15f;
@aVolpe
aVolpe / IonicMocks.ts
Created December 7, 2018 14:14
Simple mocks for ionic
export class MockLoading {
public visible: boolean;
constructor(props: any) {
Object.assign(this, props);
this.visible = false;
}
present() {
this.visible = true;