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 / fzf-change-audio-source.zsh
Last active January 8, 2024 17:00
fzf SwitchAudioSource
foutput() {
# usage:
# foutput # to open picker
# foutput speakers # to select speakers
device="$(SwitchAudioSource -a -t output |\
fzf-tmux --height=8 --cycle --no-mouse --no-multi --query=$1 -1 |\
cut -f1 -d'(' | xargs)"
SwitchAudioSource -s "$device"
}
@aVolpe
aVolpe / setupi18n.ts
Created March 9, 2023 21:42
i18next react with traduora
export async function setupI18n(config: {
traduora: {
host: string,
projectId: string,
clientId: string,
clientSecret: string
}
}) {
const token = await getTraduoraToken(config.traduora);
@aVolpe
aVolpe / send_iso_message.py
Last active July 28, 2022 21:05
jpos utils
#!/usr/bin/python
import sys
import xml.etree.cElementTree as ET
import string
import random
import socket
from datetime import datetime
if len(sys.argv) < 2:
@aVolpe
aVolpe / check_ram.js
Last active March 29, 2021 20:52
Check the ram of a jvm process using nashron (given only a jre)
function addUrlToClasspath(pathName) {
var/*java.net.URLClassLoader*/
sysloader = /*(java.net.URLClassLoader) */ java.lang.ClassLoader.getSystemClassLoader();
var/*java.lang.Class*/ sysclass = java.net.URLClassLoader.class;
var ClassArray = Java.type("java.lang.Class[]");
var parameters = new ClassArray(1);
parameters[0] = java.net.URL.class;
var/*java.lang.reflect.Method*/ method = sysclass.getDeclaredMethod("addURL", parameters);
method.setAccessible(true);
var ObjectArray = Java.type("java.lang.Object[]");
@aVolpe
aVolpe / generate_rows.py
Created July 3, 2020 15:26
Contraloria
#!/usr/bin/python3
import sys
import re
def get_file_data(file_name):
cleaned = file_name \
.replace('PERDOMO2016_1', 'PERDOMO_2016_1') \
.replace('SOSARIELLA_216', 'SOSARIELLA_2016') \
.replace('221.035', '221035') \
@aVolpe
aVolpe / NumeroALetras.ts
Last active August 21, 2019 00:55 — forked from alfchee/NumeroALetras.js
Código en JavaScript que convierte números a letras, bastante útil para formularios de documentos contables y similares
/*************************************************************/
// NumeroALetras
// The MIT License (MIT)
//
// Copyright (c) 2015 Luis Alfredo Chee
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@aVolpe
aVolpe / poi.sql
Last active March 21, 2019 13:51
senadores del py
INSERT INTO poi(name,afiliation,phone,email,type) VALUES
('AFARA MACIEL, JUAN EUDES','A.N.R.','414-5248',NULL,'SENADOR'),
('ALVARENGA DE ORTEGA, HERMELINDA','P.L.R.A','414-5156','hermelindasensei@hotmail.com','SENADOR'),
('AMARILLA GUIRLAND, DIONISIO OSWALDO','P.L.R.A','414-5135','damarill@economistas.com','SENADOR'),
('APURIL SANTIVIAGO, GILBERTO ANTONIO','PPH','414-5082',NULL,'SENADOR'),
('ARÉVALO FERNÁNDEZ, MARIO MARTÍN','A.N.R.','414-5215','martinarevalo68@gmail.com','SENADOR'),
('ARRÚA DE DOLINSKY, GEORGIA MARÍA','PPQ','414-5049',NULL,'SENADOR'),
('BACCHETTA CHIRIANI, ENRIQUE FAUSTO','A.N.R.','414-5288','ebachetta@senado.gov.py','SENADOR'),
('BAJAC DE PENNER, MARÍA EUGENIA BEATRÍZ','P.L.R.A','414-5146',NULL,'SENADOR'),
('BARRIOS FERNÁNDEZ, ANTONIO CARLOS','A.N.R.','414-5238',NULL,'SENADOR'),
@aVolpe
aVolpe / scrap.bash
Created March 7, 2019 23:34
Scrap IPS db by 'Cédula'
#!/bin/bash
# Usage:
#
# bash scrap.bash 100000 200000
START=$1
END=$2
@aVolpe
aVolpe / SchemaGeneratorDemo.java
Created December 13, 2018 18:49
SchemaGeneratorDemo
import com.github.fluent.hibernate.cfg.scanner.EntityScanner;
import org.hibernate.SessionFactory;
import org.hibernate.boot.Metadata;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.PostgreSQL94Dialect;
@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;