Skip to content

Instantly share code, notes, and snippets.

View trplll's full-sized avatar

Luke trplll

  • Wisconsin
View GitHub Profile
@trplll
trplll / codedisp.html
Created August 18, 2016 15:32
Sample: Display code in html using bootstrap
<pre>&lt;!DOCTYPE html&gt;
&lt;html ng-app="carlist"&gt;
&lt;head&gt;
&lt;meta charset="utf-8" /&gt;
&lt;title&gt;Car Lot List&lt;/title&gt;
&lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"&gt;
&lt;link rel="stylesheet" href="bstheme.css"&gt;
&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"&gt;&lt;/script&gt;
&lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"&gt;&lt;/script&gt;
@trplll
trplll / jwhh_Helper.java
Created September 18, 2016 20:46
IO Buffers try with resources. How to leverage try with resources to allow try statement to open and handle the buffer readers/writers
package com.jwhh;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.nio.file.Files;
import java.nio.file.Paths;
/**
* Created by Jim on 1/9/2016.
@trplll
trplll / FileAndDirCreateModify.java
Last active September 18, 2016 20:52
Using Java.nio.file , java.io , and java util to create and modify directories, zip directories , and files in the file system
package com.jwhh;
import java.io.BufferedWriter;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
@trplll
trplll / Main.java
Created September 18, 2016 20:54
Simple command line file read with buffer reader
package com.company;
import java.io.BufferedReader;
import java.nio.file.Files;
import java.nio.file.Paths;
public class Main {
public static void main(String[] args) {
if(args.length == 0) {
@trplll
trplll / company_Main.java
Created September 18, 2016 20:57
Using xml property files for java program
package com.company;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Properties;
@trplll
trplll / jdbc_DBType.java
Created October 11, 2016 15:26
Basic JDBC connection Utility for multiple databases
package com.trplcd.jdbc;
/**
* Created by ace01359 on 10/10/2016.
*/
public enum DBType{
AS400, MYSQLDB
}
@trplll
trplll / TryWithResources.java
Created October 18, 2016 18:33
Try vs try with resources
package com.trplcd.jdbc;
import java.sql.Connection;
import java.sql.SQLException;
/**
* Created by ace01359 on 10/10/2016.
*/
public class TestSqlCon {
@trplll
trplll / gist:8f11f6ace40d113ac58255b7398084ce
Created November 7, 2016 15:15
JDE Type Param List csv
package com.company;
public class Main{
public static void main (String[] args){
System.out.println("Tal job can convert csv Params to data selection in SQL and Talend components:\n");
System.out.println("Context Var MCUS:\n In URL/BAT:\n --context_param MCUS= 20 , 23, 301 , 21\n In Talend:\n context.MCUS = " +MCUcsvStringtoSQLStringList("20 , 23, 301 , 21"));
System.out.println("\nContext Var DCTOS:");
System.out.println(" In URL/BAT:\n --context_param DCTOS= SO, OP, ST\n In Talend:\n context.DCTOS = " +DCTcsvStringtoSQLStringList(" SO, OP, ST"));
@trplll
trplll / shipmentwoload.sql
Created November 22, 2016 15:01
Shipments without load basic query
SELECT sddoco,sdlnid,sdmcu,sdshan,RSSHPN, RSLDNM, RSPPDJ FROM F4211
join F4941 on sdshpn=rsshpn
WHERE SDNXTR>=535
AND SDNXTR<=550
AND SDPPDJ>=115326
and RSLDNM=0
AND RSPPDJ>115326
and sdmcu in (' 20')
and sdshan in (' 22',' 24',' 25',' 27',' 28')
@trplll
trplll / mapping_AS400.xml
Last active December 13, 2016 16:05
Ease the pain of importing table schemas into Talend. Change DB type "NUMERIC" mapping to have a default talend type of "id_Integer" instead of Float
<?xml version="1.0"?>
<mapping>
<dbms product="AS400" id="as400_id" label="Mapping AS400"
default="true">
<dbTypes>
<dbType type="BIT" ignoreLen="true" ignorePre="true" />
<dbType type="CHAR" defaultLength="1" ignoreLen="false" ignorePre="true" />
<dbType type="DATE" ignoreLen="true" ignorePre="true" />
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10" ignoreLen="false" ignorePre="false"/>
<dbType type="DOUBLE" ignoreLen="true" ignorePre="true" />