Skip to content

Instantly share code, notes, and snippets.

Stephan Miller eristoddle

View GitHub Profile
@eristoddle
eristoddle / bchpm.go
Created Nov 11, 2018
Encrpted Messages on the BCH blockchain using private keys and public addresses
View bchpm.go
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/hmac"
"crypto/rand"
"crypto/sha256"
"crypto/sha512"
@eristoddle
eristoddle / bash-artifactxml-gen.sh
Created Sep 1, 2017 — forked from rzrbld/bash-artifactxml-gen.sh
wso2 studio developer artifact.xml generator
View bash-artifactxml-gen.sh
#!/bin/bash
# using: bash-artifactxml-gen.sh my.project.folder
#
ROOTFOLDER=$*
#set src dir
SRCDIR=$ROOTFOLDER'/src/';
#cd to src dir
cd $SRCDIR;
#start gen artifact.xml
echo '<?xml version="1.0" encoding="UTF-8"?><artifacts>';
@eristoddle
eristoddle / deployer.sh
Created Jan 26, 2017 — forked from dulichan/deployer.sh
Script to configure WSO2 EMM
View deployer.sh
PRODUCT_HOME="$1"
IOS_CERTS="$2"
IP="$3"
PRODUCT_CONF="$4"
CONFIG_FILE="./openssl_custom.cnf"
TEMP_FOLDER="./temp"
PUSH_CERT="`echo $IOS_CERTS`pushcert.pfx"
PUSH_PASS=""
MDM_CERT="`echo $IOS_CERTS`PlainCert.pfx"
MDM_PASS=""
@eristoddle
eristoddle / README.md
Created Dec 13, 2016 — forked from lavaxun/README.md
Rancher on docker-for-mac with xhyve
View README.md

Install Docker for Mac (http://beta.docker.com)

Install docker-machine-driver-xhyve (https://github.com/zchee/docker-machine-driver-xhyve)

brew install docker-machine-driver-xhyve
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

Deploy the latest release

@eristoddle
eristoddle / ngContentEditableDirective.js
Created Sep 25, 2016
Angular 1 contenteditable Directive
View ngContentEditableDirective.js
app.directive("contenteditable", ['$rootScope', function ($rootScope) {
return {
restrict: "A",
link: function (scope, element, attrs) {
var content = '';
element.bind("blur keyup change focus", function (event) {
content = element.html();
$rootScope.editableContent = content;
});
@eristoddle
eristoddle / app.component.ts
Created Sep 25, 2016 — forked from wphax/app.component.ts
Dynamic Component Loading in Angular 2 RC4
View app.component.ts
import { Component } from '@angular/core';
import { DynamicHTMLDirective } from './dynamic-html.directive';
@Component( {
selector: 'main-layer',
directives: [ DynamicHTMLDirective ],
template: '<dynamic-html-wrap [src]="data"></dynamic-html-wrap>'
} )
export class AppComponent {
public data: string = '<something></something>';
@eristoddle
eristoddle / businessDays.js
Created Aug 22, 2016 — forked from balazsbohonyi/businessDays.js
Adding/Subtracting Business Days in Javascript (extends the native Date Javascript object)
View businessDays.js
Number.prototype.mod = function(n) {
return ((this%n)+n)%n;
}
// support for adding/subtracting business days for Javascript dates
Date.prototype.addBusinessDays = function(days) {
days = parseInt(days);
var wks = Math.floor(days/5);
var dys = days.mod(5);
var dy = this.getDay();
@eristoddle
eristoddle / h2oToNueralNetTools.R
Last active May 18, 2016
R script to take an H2o models weights and biases and send them through the NeuralNetTools olden variable importance function...and first time I have used R so I could be doing things totally wrong but it works.
View h2oToNueralNetTools.R
#Rscript processModel.R
#http://rpackages.ianhowson.com/cran/NeuralNetTools/man/olden.html
#https://cran.r-project.org/web/packages/nnet/nnet.pdf
library(NeuralNetTools)
library(h2o)
library(jsonlite)
model_id <- 'deeplearning-f168835d-9e6e-4170-b881-fb5f214f302b'
localH2O <- h2o.init()
@eristoddle
eristoddle / merge_csv.py
Created Apr 25, 2016
Merge csvs with Pandas
View merge_csv.py
from glob import iglob
import pandas as pd
files = sorted(iglob('*.csv'))
frames = [ pd.read_csv(f) for f in files ]
result = pd.concat(frames)
final_csv = result.to_csv('./final.csv')
@eristoddle
eristoddle / new_gist_file.ps1
Created Mar 29, 2016
Powershell script to parse xml in csv and expand it
View new_gist_file.ps1
$records = Import-Csv BadResults.csv
foreach($record in $records){
$xml = new-object System.Xml.XmlDocument
$fraudScore = $record.FraudScoreDetails
$xml.LoadXml($fraudScore)
foreach ($i in $xml.response.rule){
#Write-Output $i.criteriaEvaluated
#Write-Output $i.evaluationResult
$record | Add-Member NoteProperty $i.criteriaEvaluated $i.evaluationResult
You can’t perform that action at this time.