Skip to content

Instantly share code, notes, and snippets.

@jbaranski
jbaranski / SingleJarDownload.md
Created Aug 1, 2020
Download a Single Dependency with Maven
View SingleJarDownload.md
@jbaranski
jbaranski / AddH2UserPass.md
Created Aug 1, 2020
Add User and Password to Existing H2 Database
View AddH2UserPass.md

I needed to password protect an existing H2 database. I wanted to do two things:

  • Delete existing ADMIN user, who had no user name or password:

DROP USER "";

  • Create a new user, add a password for the new user:

CREATE USER IF NOT EXISTS example PASSWORD 'example password' ADMIN;

@jbaranski
jbaranski / Trie.js
Last active Feb 11, 2020 — forked from tpae/Trie.js
Trie.js - super simple JavaScript implementation
View Trie.js
/* tslint:disable */
import { AutocompleteCandidate } from '../autocomplete/candidate';
// Source code token from below link
// https://gist.github.com/tpae/72e1c54471e88b689f85ad2b3940a8f0
// @MODIFIED has been added where modifications have been made
//
// Trie.js - super simple JS implementation
// https://en.wikipedia.org/wiki/Trie
@jbaranski
jbaranski / multi-table-sort-angular.ts
Last active Jul 12, 2020
Multi table angular sort
View multi-table-sort-angular.ts
// assume you have a member on the component like dataSource1: MatTableDataSource<any>; and dataSource2: MatTableDataSource<any>; that
// are the datasources for the two tables
@ViewChildren(MatSort) set matSort(matSortList: QueryList<MatSort>) {
const ref = this;
matSortList.forEach((matSort: any, index: number) => {
const dataSource = ref['dataSource' + (index + 1)];
// https://material.angular.io/components/table/api
// to see about sortingDataAccessor
dataSource.sortingDataAccessor = (item: any, property: string) => {
if (cond1) {
@jbaranski
jbaranski / oracledb.py
Created Sep 4, 2016
Python Oracle DB connection wrapper
View oracledb.py
"""
Oracle database connection wrapper
@author: jbaranski
"""
import cx_Oracle
class OracleDB:
"""
Usage:
@jbaranski
jbaranski / nexus_upload.sh
Last active May 18, 2020
Artifact upload to nexus using curl
View nexus_upload.sh
# nexus 2.x
# Assuming you run this command against the directory the jar sits in
#
# r - repository
# hasPom - whether you are supplying the pom or you want one generated. If generated g, a, v, p, and c are not needed
# e - extension
# g - group id
# a - artifact id
# v - version
# p - packaging
You can’t perform that action at this time.