Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am vpavic on github.
  • I am vpavic (https://keybase.io/vpavic) on keybase.
  • I have a public key whose fingerprint is 2CF2 58BB 901E 590F 8199 7ADD 9B80 3BA4 F405 9522

To claim this, I am signing this object:

-- PostgreSQL
CREATE USER demo WITH PASSWORD 'demo';
CREATE DATABASE demo WITH OWNER demo;
-- JDBC connection string: jdbc:postgresql://[HOST][:PORT]/demo
-- MySQL
CREATE DATABASE demo;
GRANT ALL ON demo.* TO demo@localhost IDENTIFIED BY 'demo';
-- JDBC connection string: jdbc:mysql://[HOST][:PORT]/demo
@vpavic
vpavic / hr-pin-plpgsql.sql
Created April 25, 2016 21:26
PostgreSQL functions for Croatian Personal Identification Number (OIB)
-- PostgreSQL functions for Croatian Personal Identification Number (OIB)
--
-- Reference:
-- https://en.wikipedia.org/wiki/Personal_identification_number_(Croatia)
-- http://www.regos.hr/UserDocsImages/KONTROLA%20OIB-a.pdf
CREATE OR REPLACE FUNCTION hr_pin_control_number(pin_base TEXT) RETURNS INTEGER AS $$
DECLARE
pin_digit INTEGER;
control INTEGER;
@vpavic
vpavic / logback-spring.xml
Last active July 24, 2016 20:41
Logback configuration template for Spring Boot applications.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<jmxConfigurator/>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<if condition='isDefined("LOG_PATH")'>
<then>
<property name="LOG_FILE" value="${LOG_PATH}/application.log"/>