Skip to content

Instantly share code, notes, and snippets.

View donhenton's full-sized avatar

Don Henton donhenton

View GitHub Profile
@donhenton
donhenton / GulpFile for Monitoring Node App
Last active March 11, 2016 14:23
gulp file for frontend and backend monitoring of a node app using nodemon for backend
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var watch = require('gulp-watch');
var livereload = require('gulp-livereload');
var tap = require('gulp-tap');
var nodemon = require('gulp-nodemon');
var path = require('path');
var gutil = require('gulp-util');
@donhenton
donhenton / gulpfile for tomcat update
Last active April 27, 2017 14:31
gulpfile to update tomcat when changes take place
/**
*
* @type Module gulp|Module gulp
* gulp file that will monitor files in the src tree and then move them
* to the tomcat instance. In effect a poor-man's JRebel
*
* Your tomcat server needs to be running and to see the changes
* This script will also refresh one page of your choice specified in the
* refresh page. Refreshing the page requires installation of the chrome
* live reload plugin
@donhenton
donhenton / gulpfile.js for dev
Last active May 3, 2016 18:35
Gulp file for single page development for bundling js, sass, and serve see https://github.com/donhenton/knockout-sandbox
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var gulp = require('gulp');
var gutil = require('gulp-util');
var watch = require('gulp-watch');
var server = require('gulp-server-livereload');
var livereload = require('gulp-livereload');
var del = require('del');
@donhenton
donhenton / filedownloader.js
Created May 7, 2016 13:23 — forked from DavidMah/filedownloader.js
File Download requests using jquery/POST request with psuedo ajax
// Takes a URL, param name, and data string
// Sends to the server.. The server can respond with binary data to download
jQuery.download = function(url, key, data){
// Build a form
var form = $('<form></form>').attr('action', url).attr('method', 'post');
// Add the one key/value
form.append($("<input></input>").attr('type', 'hidden').attr('name', key).attr('value', data));
//send request
form.appendTo('body').submit().remove();
@donhenton
donhenton / react-watch.js
Created June 15, 2016 14:08
react and gulp for SPA development
var gulp = require('gulp');
var gutil = require('gulp-util');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var watchify = require('watchify');
var reactify = require('reactify');
var notifier = require('node-notifier');
var server = require('gulp-server-livereload');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
@donhenton
donhenton / aws_start.sh
Last active September 15, 2017 16:22
Amazon AWS Provisioning Script
#bin/sh
# run this as the ec2-user
# java
# https://gist.github.com/rtfpessoa/17752cbf7156bdf32c59
wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.rpm
sudo rpm -i jdk-8u144-linux-x64.rpm
export JAVA_HOME=user/java/default
@donhenton
donhenton / install_nvm.sh
Created August 27, 2017 21:58
install script for nvm
#!/usr/bin/env bash
{ # this ensures the entire script is downloaded #
nvm_has() {
type "$1" > /dev/null 2>&1
}
nvm_install_dir() {
echo "${NVM_DIR:-"$HOME/.nvm"}"
@donhenton
donhenton / FileSplitter.java
Last active December 14, 2017 14:37
Java 8 File Splitter Demonstrating Files and Path Usage
package com.dhenton9000.anttask;
import java.io.File;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.nio.file.FileVisitOption;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
@donhenton
donhenton / gulpfile.js
Created December 20, 2017 14:15
Gulp file using browser sync and sass
/*
package.json
{
"name": "survey-css",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "node get a job"
},
@donhenton
donhenton / duplicateProcess.java
Last active March 1, 2018 21:27
Find a duplicate in a list and create unique map keys
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javafx.util.Pair;