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>';
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=""
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

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;
});
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>';
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();
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()
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')
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
View appify
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh