Skip to content

Instantly share code, notes, and snippets.

View juandbc's full-sized avatar
🏠
Working from home

Juan David Bermudez Celedon juandbc

🏠
Working from home
  • La Guajira
  • 10:24 - 5h behind
View GitHub Profile
@juandbc
juandbc / app.sh
Created April 18, 2021 20:15
Spring boot as sysv service
#!/bin/sh
### BEGIN INIT INFO
# Provides:
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: app description
# Description: app description
### END INIT INFO
@juandbc
juandbc / disableServices.ps1
Last active June 29, 2024 08:11
Script to disable unnecesary Windows services and improve the performance.
#####################################################################################################################
# Script to disable unnecesary Windows services and improve the performance.
#
# This use the command Set-Service, you can check the below link for more information
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-service?view=powershell-7
#
# You should check what service you want to disable, like Windows defender, Windows Search
# or Seclogon (necesary for some programs or games).
# Some services were removed in Windows 10.
#####################################################################################################################
#
# This is a little script to populate Firefox Sync with
# fake password records. Use it like so:
#
# $> pip install PyFxA syncclient cryptography
# $> python ./upload_fake_passwords.py 20
#
# It will prompt for your Firefox Account email address and
# password, generate and upload 20 fake password records, then
# sync down and print all password records stored in sync.
@juandbc
juandbc / regexpr.md
Last active February 21, 2025 18:45
Expresiones regulares útiles

Notas de RegExp útiles

Buscar número con o sin formato de miles

(?:^(?:[0-9]{1,3})(?:(?:\.{0,1}(?:[0-9]{3}))\b)+)$|(^[0-9]+$)

Obtener número de un texto (JS)

let matches = string.match(/(^\d+|^\-\d+)/gi);

Aplicar formato moneda (JS)

@juandbc
juandbc / executePLSqlFunctions.java
Last active July 24, 2019 18:39
How to execute stored procedure with JDBC
import java.sql.*;
public class Main {
public static void main(String[] args) {
String sql = "{? = call fn_test()}";
try (Connection conn = getConnection(); CallableStatement callableStatement = conn.prepareCall(sql);
PreparedStatement preparedStatement = conn.prepareStatement("select fn_test()")) {
// Execute stored procedured CallableStatement (recommend way)
callableStatement.registerOutParameter(1, Types.VARCHAR);