Skip to content

Instantly share code, notes, and snippets.

Don Henton donhenton

Block or report user

Report or block donhenton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@donhenton
donhenton / aws kms decrypt-encrypt.md
Last active Jul 29, 2019
Decrypt/Encrypt Using AWS and CLI
View aws kms decrypt-encrypt.md

Encryption

aws kms encrypt --key-id <kms-id> \
--profile default \
--plaintext fileb://input_file.txt \
--query CiphertextBlob \
--output text \
	| base64 --decode > output.enc

@donhenton
donhenton / easing.js
Created Mar 28, 2019 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
View easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@donhenton
donhenton / gulpfile.js
Created Jan 17, 2019
Updated Browserify/Babel for Babel7
View gulpfile.js
var gulp = require('gulp');
var targetLocation = './public_html/'
var appDependencies = require('./package.json').dependencies;
var SASS_FILES = ['./src/sass/*.scss', './src/sass/components/*.scss'];
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var fs = require('fs');
var del = require('del');
@donhenton
donhenton / gulpfile.js
Created Jan 17, 2019 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
View gulpfile.js
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@donhenton
donhenton / isAtScrollBottom.js
Created Dec 12, 2018
detect if a browser hits bottom
View isAtScrollBottom.js
isAtScrollBottom() {
//https://gist.github.com/nathansmith/8939548
//https://www.quora.com/How-do-you-detect-in-JavaScript-when-a-user-has-scrolled-to-the-bottom-of-the-page
//https://stackoverflow.com/questions/1145850/how-to-get-height-of-entire-document-with-javascript
//https://techstacker.com/posts/gGyGTHysrPuuJnNBk/vanilla-javascript-detect-when-user-scrolled-to-the-bottom
let body = document.body;
let html = document.documentElement;
var height = Math.max(body.scrollHeight, body.offsetHeight,
html.clientHeight, html.scrollHeight, html.offsetHeight);
@donhenton
donhenton / docker-compose.yml
Last active Jun 7, 2018
Redis/Redis-commander Docker Compose with Persistence
View docker-compose.yml
version: '3'
services:
redis:
container_name: redis
hostname: redis
image: redis
command: ["redis-server", "--appendonly", "yes"]
volumes:
- ~/redis/data:/data
ports:
@donhenton
donhenton / duplicateProcess.java
Last active Mar 1, 2018
Find a duplicate in a list and create unique map keys
View duplicateProcess.java
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;
@donhenton
donhenton / gulpfile.js
Created Dec 20, 2017
Gulp file using browser sync and sass
View gulpfile.js
/*
package.json
{
"name": "survey-css",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "node get a job"
},
@donhenton
donhenton / FileSplitter.java
Last active Dec 14, 2017
Java 8 File Splitter Demonstrating Files and Path Usage
View FileSplitter.java
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 / install_nvm.sh
Created Aug 27, 2017
install script for nvm
View install_nvm.sh
#!/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"}"
You can’t perform that action at this time.