Skip to content

Instantly share code, notes, and snippets.

Eduardo Lundgren eduardolundgren

  • Liferay, Inc.
  • California
Block or report user

Report or block eduardolundgren

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
View interactive.html
<!DOCTYPE html>
<html>
<body>
<script>
assert(document.readyState === 'loading');
document.addEventListener("DOMContentLoaded", function() {
assert(document.readyState === 'interactive'); // <--
setTimeout(function() {
assert(document.readyState === 'complete');
}, 0);
View users.json
[
{ "avatarUrl" : null,
"email" : "hi@personal.ro",
"firstName" : "Emery",
"id" : "105288343523146387",
"invitationPending" : false,
"lastName" : "Stafford",
"password" : "yggFjgBNLBN43wkyhKhOu41A67tNV4gw",
"passwordResetToken" : null,
"passwordResetTokenDate" : null
View books.json
[
{
"document": {
"title": "Neuromancer",
"year": 1984,
"isbn": "0441569595",
"authors": [
"William Gibson"
]
},
View createDummyNullable.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
function createDummyNullable(target) {
return new Proxy(target, {
View sequence.js
CancellablePromise.sequence = function(values) {
var children = [];
return new A.CancellablePromise(
function(resolve, reject) {
if (!A.Lang.isArray(values)) {
reject(new TypeError('CancellablePromise.sequence expects an array of values or promises'));
return;
}
View CancellablePromise.js
/**
* Cancellable promise.
*
* @class CancellablePromise
* @constructor
* @extends {Promise}
* @param {Function} fn A function where to insert the logic that resolves this
* promise. Receives `fulfill` and `reject` functions as parameters. This
* function is called synchronously.
* @param {Function} opt_errorCallback Optional error callback to be fired
View cancellable_promise.js
/**
* Error used as a rejection reason for canceled Promises.
*
* @class Promise.CancellationError
* @constructor
* @extends {Error}
* @param {String} opt_message An optional debugging message for describing the
* cancellation reason.
*/
function CancellationError(opt_message) {
@eduardolundgren
eduardolundgren / Y.App.js
Created Mar 5, 2014
Y.App rendering each view in a different element
View Y.App.js
Y.HeaderView = Y.Base.create('header', Y.View, [], {
ATTRS: {
container: { value: '#header' }
}
});
Y.BodyView = Y.Base.create('body', Y.View, [], {
ATTRS: {
container: { value: '#body' }
}
View writeTempFile.js
function writeTempFile(content, opt_callback) {
tmp.file({ postfix: '.html' }, function(err, tmpHtmlPath) {
if (!err) {
grunt.file.write(tmpHtmlPath, content);
}
opt_callback && opt_callback(err, tmpHtmlPath);
});
}
View html2pdf.js
function html2pdf(path, outputPath, opt_callback) {
phantom.create(function(ph) {
ph.createPage(function(page) {
page.set('paperSize', {
format: 'A4',
orientation: 'portrait'
});
page.open(path, function() {
You can’t perform that action at this time.