Skip to content

Instantly share code, notes, and snippets.

View ericeijkelenboom's full-sized avatar

Eric Eijkelenboom ericeijkelenboom

View GitHub Profile
@ericeijkelenboom
ericeijkelenboom / install-spark-0.9.1-hadoop1.sh
Created May 21, 2014 08:15
Install Spark 0.9.1 on an EMR cluster
cd /home/hadoop/
##Download Spark
hadoop fs -copyToLocal s3://prediction-data/spark-jobs/dist/0.9.1/spark-0.9.1-emr.tgz ./spark-0.9.1-emr.tgz
##Download Scala
wget http://www.scala-lang.org/files/archive/scala-2.10.4.tgz
tar -xvzf scala-2.10.4.tgz
tar -xvzf spark-0.9.1-emr.tgz
@ericeijkelenboom
ericeijkelenboom / emr_bootstrap_java_8.sh
Created April 3, 2014 09:39
Bootstrap script for installing Java 8 on an Amazon Elastic MapReduce instance (AMI 3.0.1)
# Check java version
JAVA_VER=$(java -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q')
if [ "$JAVA_VER" -lt 18 ]
then
# Download jdk 8
echo "Downloading and installing jdk 8"
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-x64.rpm"
# Silent install
@ericeijkelenboom
ericeijkelenboom / Single Page App Presentation.js
Last active December 16, 2015 17:59
Presentation: building a Single Page App
breeze.NamingConvention.camelCase.setAsDefault();
var mgr = new breeze.EntityManager('http://qrcampaign.azurewebsites.net/api/subscriptions');
if (forceRemote)
query = query.using(breeze.FetchStrategy.FromServer);
else
query = query.using(...);
function init() {
return mgr.fetchMetadata();
}
<section ...>
<h2 class="page-title" ...></h2>
<form>
<label>Description</label>
<input type="text" .../>
<label>Number of points before redeem</label>
<input type="text" .../>
function getCampaignById(id) {
return mgr.fetchEntityByKey('Campaign', id, true);
}
function showDetails(campaign) {
router.navigateTo('...' + campaign...);
}
<table class="table table-hover">
<thead>
<tr>
<th>Campaign name</th>
<th>Number of points before redeem</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
protected void Application_Start()
{
// Add the Breeze CORS handler
GlobalConfiguration.Configuration.MessageHandlers.Add(new BreezeSimpleCorsHandler());
// All other code here
}