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
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",
seriesKeys:["temperature"],
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>
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]
View controller.server.js
/*jslint anon:true, sloppy:true, nomen:true*/
YUI.add('Foo', function(Y, NAME) {
/**
* The Foo module.
*
* @module Foo
*/
/**
@ItsAsbreuk
ItsAsbreuk / queryPromise.js
Last active Dec 24, 2015
queryPromise for node-mysql
View queryPromise.js
/*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 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 !! 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(); });
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
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 --> 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/...
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.