Skip to content

Instantly share code, notes, and snippets.

/**********************************************
* Ink v1.0.5 - Copyright 2013 ZURB Inc *
**********************************************/
/* Client-specific Styles and Reset */
#outlook a {
padding:0;
}
@eXeDK
eXeDK / gist:45850b62ae29afd8dac6
Created April 3, 2015 21:36
EventHandler class
<?php
require_once 'EventPriorityQueue.php';
/**
* Class EventHandler
*/
class EventHandler {
/**
* Holds all events in an array of EventPriorityQueues
*
<?php
/**
* Class Event
*/
class Event {
/**
* Contains the function of the Event
*
@eXeDK
eXeDK / gist:9863d9fadc0588c3ed53
Last active August 29, 2015 14:18
Simple Closure object
$testLocalFunction = function() {
echo 'Hello World<br/>';
};
echo var_dump($testLocalFunction); // object(Closure)[1]
def dataPartition(data: Array[DataPoint], output: Array[Array[DataPoint]], defaultSize: Int, remainingRest: Int): Array[Array[DataPoint]] = {
if (data.nonEmpty) {
val thisPartitionSize = if (remainingRest > 0) { defaultSize + 1} else { defaultSize }
val nextRemainingRest = if (remainingRest > 0) { remainingRest - 1 } else { remainingRest }
val thisPartition = data.slice(0, thisPartitionSize)
val remainingData = data.drop(thisPartitionSize)
dataPartition(remainingData, output :+ thisPartition, defaultSize, nextRemainingRest)
} else {
output