Skip to content

Instantly share code, notes, and snippets.

@tepie
tepie / cvs_patch_from_log.py
Last active April 17, 2018 12:41
cvs_patch_from_log.py will take a changelog from CVS and generate diff commands for that given files to execute for code review. run_codereivew.sh is an example of how to execute, CODEREVIEW.LOG contains the cvs changelog, CODEREVIEW.SH contains the diff commands generated which can be executed and then examined for code review.
#!/usr/bin/python
import os, sys, re, time
if __name__ == '__main__':
cvs_log = open(sys.argv[1])
patch_file = None
if len(sys.argv) > 2:
@tepie
tepie / LocaleDateFormatTest.java
Last active April 12, 2018 15:10
LocaleDateFormatTest will access the builtin java date time formats for a locale and print a date in that format. testPrintEveryLocal.txt is the results of the test after it is executed.
package sun.text.resources;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.Locale;
@tepie
tepie / simple-eventchain-demo.html
Created February 23, 2017 13:52
Demonstrates how to manage events in javascript with jQuery
<!doctype html>
<html>
<head>
<title>simple-eventchain-demo</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
<button type="button" data-demo-action="start">Start Demo</button>
@tepie
tepie / SuggestionTextBox.js
Created March 2, 2013 18:33
export suggest values that are not numbers
$(".SuggestionTextBox").each(function(){ if (isNaN ($(this)[0].value) ) console.log($(this)[0].value); });
@tepie
tepie / exec.sftp.ls.xml
Last active December 11, 2015 18:39
exec sftp directory list via ant
<exec os="Linux" executable="sftp" inputstring='ls -l ${remote.directory}'>
<arg line='-o Protocol=2 -o IdentityFile=${KEYFILE} ${USER}@${HOST}' />
</exec>
@tepie
tepie / gist:4078880
Created November 15, 2012 14:28
db2 load over jdbc with CALL SYSPROC.ADMIN_CMD
<sql driver="${DB.DB2.DRIVER}" url="${DB.DB2.JDBC.URL}" userid="${DB.DB2.USER}" password="${DB.DB2.PASSWORD}">
<classpath>
<pathelement location="${DB.DB2.CLASSPATH}"/>
</classpath><![CDATA[
CALL SYSPROC.ADMIN_CMD('
load from ${remote.directory.put.to}/${LOCAL.FILE.LOGAN.PARSED} of del modified by coldel| method P(..... ) insert into ${DB.DB2.SCHEMA}.${DB.DB2.TABLE} (....) nonrecoverable
');
]]></sql>
@tepie
tepie / build.xml
Created October 12, 2012 13:59
The most basic java compile and jar build.xml ever
<?xml version="1.0"?>
<project name="project" basedir="." default="jar">
<property file="build.properties"/>
<target name="clean">
<delete dir="dist" />
<delete dir="build" />
<mkdir dir="dist"/>
<mkdir dir="build"/>