Skip to content

Instantly share code, notes, and snippets.

Marco Asbreuk ItsAsbreuk

Block or report user

Report or block ItsAsbreuk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ItsAsbreuk / .babelrc
Last active Mar 10, 2016
Flattening nested array
View .babelrc
"presets": ["es2015"]
View example-chart-modellist.js
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",
axes: {
category: {
View chart-datasource-plugin.js
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) {
View gist:8299370
<VirtualHost *:80>
ServerAlias *
DocumentRoot "/var/www/vhosts/"
<IfModule rewrite_module>
RewriteEngine on
RewriteCond %{HTTP:X-PJAX} ^true$
RewriteRule (.*) /pjaxdir/$1 [L]
# or:
# RewriteRule (.*) processpjax.php?uri=$1 [L]
View controller.server.js
/*jslint anon:true, sloppy:true, nomen:true*/
YUI.add('Foo', function(Y, NAME) {
* The Foo module.
* @module Foo
ItsAsbreuk / queryPromise.js
Last active Dec 24, 2015
queryPromise for node-mysql
View queryPromise.js
/*jshint maxlen:205 */
* 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:
ItsAsbreuk / gist:6712217
Last active Dec 23, 2015
publishAsync method at the prototype of Y.Model, which publishes events with asynchronous defaultFn and preventedFn Promises
View gist:6712217
// Special thanks to Luke Smiths !!, who helped me creating this custom publish-method.
// More details
YModel.prototype.publishAsync = function(type, opts) {
var instance = this,
asyncEvent = this.publish(type, opts);
asyncEvent._firing = new Y.Promise(function (resolve) { resolve(); });
View gist:6676361
/*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 / directory-structure
Last active Dec 19, 2015
Comboloader configuration. For using the comboloader on node.js and serving your own modules. Both through http and https.
View directory-structure
You must download the yui3-files (for every version you want to serve) as well as the Gallery-modules.
Yui3 --> or
Gallery --> download zip from
The Gist presumes the next directory-structure on the server:
View gist:5599714
Y.PieModel = Y.Base.create('pieModel', Y.Model, [], {
initializer: function () {
this.internalModellist = new Y.ModelList();
_setModelList: function (newdata) {
return this.internalModellist.reset(newdata);
You can’t perform that action at this time.