Skip to content

Instantly share code, notes, and snippets.

View leonelag's full-sized avatar

Leonel leonelag

  • Sorocaba - Brazil
View GitHub Profile
@leonelag
leonelag / gist:5732218
Created June 7, 2013 20:34
Find version of the current Oracle instance you are connected to.
select * from v$version
@leonelag
leonelag / Pair.java
Created June 14, 2013 12:45
Immutable pair of elements. I have used this in many projects, too bad the Java library does not include it by default.
package util;
public class Pair<T extends Comparable<T>, U extends Comparable<U>> implements Comparable<Pair<T,U>> {
private T first;
private U second;
public Pair(T first, U second) {
if (first == null) throw new IllegalArgumentException("First argument must not be null");
if (second == null) throw new IllegalArgumentException("Second argument must not be null");
this.first = first;
@leonelag
leonelag / gist:6500811
Created September 9, 2013 20:08
Paste this in the REPL to see the current classpath of the application.
(println (string/join "\n"
(string/split (get (System/getProperties)
"java.class.path")
#";")))
@leonelag
leonelag / Main.java
Created March 15, 2018 19:53
Force Spring Boot application to use a config file.
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
public class Main {
private static final String CONFIG_NAME = "myapp"; // FIXME - this will read configs from file myapp.properties; fix as required
@leonelag
leonelag / clojure.sh
Last active April 13, 2021 00:58
Clojure launcher for cygwin
#!/usr/bin/env bash
#
# From: https://raw.githubusercontent.com/clojure/brew-install/1.9.0/src/main/resources/clojure
#
# Version = 1.10.3.814
project_version=1.10.3.814
# Check for cygwin
#!C:/cygwin64/bin/bash.exe
# Version = 1.10.1.462
set -e
function join { local d=$1; shift; echo -n "$1"; shift; printf "%s" "${@/#/$d}"; }
#
# LLGD: this is to avoid confusion between C:\cygwin64\bin\cygpath.exe and C:\local\Git\cygpath.exe