Skip to content

Instantly share code, notes, and snippets.

View eppfel's full-sized avatar

Felix A. Epp eppfel

View GitHub Profile
@eppfel
eppfel / sketch.js
Created May 19, 2017 09:59
p5.js Template for classes
var MyClass = function(position, color) {
this.position = position;
this.color = color;
this.change = function () {
//z.B. die Position, Farbe, o.ä. ändern/neu berechnen
};
this.draw = function () {
// das einzelnen Objekt wird gezeichnet
};
}
var throwDice = function () {
return Math.floor(Math.random() * (6)) + 1;
};
var results = [0,0,0,0,0,0];
var iterations = 10000000;
for (var i = 0; i < iterations; i++) {
results[throwDice()-1]++;
@eppfel
eppfel / delete-Obsolete-Cask.sh
Created August 30, 2016 14:23
I had problems uninstalling Homebrew Casks due to old metadata
for f in /usr/local/Caskroom/*/* ; do
package="$(basename "$(dirname "${f}")")"
version="$(basename "${f}")"
test -e "/usr/local/Caskroom/${package}/.metadata/${version}" || rm -rf "/usr/local/Caskroom/${package}/${version}"
done
@eppfel
eppfel / customAlert.ics
Last active April 13, 2016 12:36
Example event for OSX calendar to set a custom alert time. The magic happens in the VALARM part. The TRIGGER defines the time for the alert. For AllDayEvents the start time is 00:00. So for an alter at 18:00 we set the value to -PT6H.
BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
DTSTART;VALUE=DATE:20160413
DTEND;VALUE=DATE:20160414
DESCRIPTION:Example event to import in OSX calendar and simultaneously
setting an alert at a custom time, here 18:00 (event start -6 hours)
LOCATION:Darmstadt, Europe, Earth, Milky Way
TRANSP:TRANSPARENT
var interactionsCollection = [];
localforage.getItem('Interactions').then(function (interactionKeys) {
interactionKeys.forEach(function(key) {
localforage.getItem(key).then(function (data) { interactionsCollection.push(data)})})
});
var allInteractions = [];
var keyc = 0;
localforage.keys(function(keys) {
keys.forEach(function (key){
@eppfel
eppfel / greetings.json
Created January 13, 2016 00:06
Just a quick way to publish a little json
{
"de": "Guten Tag!",
"es": "¡Hola!",
"fr": "Bonjour!",
"it": "Buongiorno!"
}