Skip to content

Instantly share code, notes, and snippets.

View ItsAsbreuk's full-sized avatar

Marco Asbreuk ItsAsbreuk

View GitHub Profile
@ItsAsbreuk
ItsAsbreuk / keybase.md
Created September 23, 2019 11:30
Keybase identification

Keybase proof

I hereby claim:

  • I am itsasbreuk on github.
  • I am itsasbreuk (https://keybase.io/itsasbreuk) on keybase.
  • I have a public key ASC3LbCTYNS0wdIpUq2eU_v8oEqMfQfcw6Hc2oI59jkeBAo

To claim this, I am signing this object:

@ItsAsbreuk
ItsAsbreuk / .babelrc
Last active March 10, 2016 11:29
Flattening nested array
{
"presets": ["es2015"]
}
YUI({gallery: 'gallery-2014.03.12-23-08'}).use('chart', 'lazy-model-list', 'gallery-io-utils', 'gallery-itsamodellistsyncpromise', function(Y) {
var URL = "../data/PumpReports.php",
cyclesChart, chartData;
cyclesChart = new Y.Chart({
categoryKey: "dateTime",
categoryType: "time",
seriesKeys:["temperature"],
axes: {
category: {
Y.namespace('Plugin').ChartDataSource = Y.Base.create('chartDataSource', Y.Plugin.DataTableDataSource, [], {
/**
* Callback function passed to DataSource's sendRequest() method populates
* an entire DataTable with new data, clearing previous data, if any.
*
* @method onDataReturnInitializeTable
* @param e {EventFacade} DataSource Event Facade object.
*/
onDataReturnInitializeTable : function(e) {
@ItsAsbreuk
ItsAsbreuk / gist:8299370
Created January 7, 2014 13:38
Y.App apache-conf
<VirtualHost *:80>
ServerName mydomain.com
ServerAlias mydomain.com *.mydomain.com
DocumentRoot "/var/www/vhosts/mydomain.com/httpdocs"
<IfModule rewrite_module>
RewriteEngine on
RewriteCond %{HTTP:X-PJAX} ^true$
RewriteRule (.*) /pjaxdir/$1 [L]
# or:
# RewriteRule (.*) processpjax.php?uri=$1 [L]
@ItsAsbreuk
ItsAsbreuk / controller.server.js
Last active December 29, 2015 16:49
mojitopromises
/*jslint anon:true, sloppy:true, nomen:true*/
YUI.add('Foo', function(Y, NAME) {
/**
* The Foo module.
*
* @module Foo
*/
/**
@ItsAsbreuk
ItsAsbreuk / queryPromise.js
Last active December 24, 2015 09:38
queryPromise for node-mysql
/*jshint maxlen:205 */
/*
* SPECIAL NOTE 1:
*
* This code is created as a yui-module inside Mojito.
* If you need it as standalone for any Nodejs-project, you need to require YUI as well.
*
* See: http://yuilibrary.com/yui/docs/yui/nodejs.html
*
@ItsAsbreuk
ItsAsbreuk / gist:6712217
Last active December 23, 2015 23:49
publishAsync method at the prototype of Y.Model, which publishes events with asynchronous defaultFn and preventedFn Promises
// Special thanks to Luke Smiths !! https://github.com/lsmith, who helped me creating this custom publish-method.
// More details https://gist.github.com/lsmith/6664382/db6e9e3342d5a7610d0efc3e4b72b480604ce46a
YModel.prototype.publishAsync = function(type, opts) {
var instance = this,
asyncEvent = this.publish(type, opts);
asyncEvent._firing = new Y.Promise(function (resolve) { resolve(); });
@ItsAsbreuk
ItsAsbreuk / gist:6676361
Last active December 23, 2015 18:29 — forked from lsmith/gist:6664382
/*global SM:true*/
'use strict';
// Publish a very special, promise-compatible event that supports the default
// function behavior to chain on internally created promises before executing
// the after() subs. on() subs can still e.preventDefault(), which will
// reject the promise and thus skip the default behavior and after() subs.
var asyncEvent = eventTarget.publish('foo');
asyncEvent._firing = new Y.Promise(function (resolve) { resolve(); });
@ItsAsbreuk
ItsAsbreuk / directory-structure
Last active December 19, 2015 21:58
Comboloader configuration. For using the comboloader on node.js and serving your own modules. Both through http and https.
You must download the yui3-files (for every version you want to serve) as well as the Gallery-modules.
Yui3 --> http://yuilibrary.com/yui/quick-start/ or https://github.com/yui/yui3
Gallery --> download zip from https://github.com/yui/yui3-gallery
The Gist presumes the next directory-structure on the server:
/usr/local/yui_libraries/
/usr/local/yui_libraries/yui3/
/usr/local/yui_libraries/yui3/3.10.3/...