Skip to content

Instantly share code, notes, and snippets.

View eristoddle's full-sized avatar

Stephan Miller eristoddle

View GitHub Profile
@eristoddle
eristoddle / bash-artifactxml-gen.sh
Created September 1, 2017 18:33 — forked from rzrbld/bash-artifactxml-gen.sh
wso2 studio developer artifact.xml generator
#!/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 January 26, 2017 22:44 — forked from dulichan/deployer.sh
Script to configure WSO2 EMM
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 December 13, 2016 18:20 — forked from lavaxun/README.md
Rancher on docker-for-mac with xhyve

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 / app.component.ts
Created September 25, 2016 06:11 — forked from wphax/app.component.ts
Dynamic Component Loading in Angular 2 RC4
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 August 22, 2016 20:12 — forked from balazsbohonyi/businessDays.js
Adding/Subtracting Business Days in Javascript (extends the native Date Javascript object)
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 / appify
Created November 2, 2015 18:25 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/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
#include <unistd.h>
#include <node.h>
#include <string.h>
#include <v8.h>
using namespace v8;
unsigned long long count = 0;
// native blocking/compute intensive function
@eristoddle
eristoddle / revert.sh
Last active August 29, 2015 14:21 — forked from kugaevsky/revert.sh
$ cd /usr/local
$ git checkout b64d9b9c431642a7dd8d85c8de5a530f2c79d924 Library/Formula/node.rb
$ brew unlink node
$ brew install node
$ npm install -g npm@latest
#!/bin/bash
# nodereinstall
# credit: http://stackoverflow.com/a/11178106/2083544
#
# UPDATE: I've converted this gist to a repo:
# https://github.com/brock/node-reinstall
#
# get sudo
@eristoddle
eristoddle / pre-render.js
Last active August 29, 2015 14:20 — forked from mef/pre-render.js
// pre-render d3 charts at server side
var d3 = require('d3')
, jsdom = require('jsdom')
, fs = require('fs')
, htmlStub = '<html><head></head><body><div id="dataviz-container"></div><script src="js/d3.v3.min.js"></script></body></html>'
jsdom.env({
features : { QuerySelector : true }
, html : htmlStub
, done : function(errors, window) {