Skip to content

Instantly share code, notes, and snippets.

CheddrUtil = new function() {
this.globals = {
waitForThen: function (things, what) {
for (i=0;i<=things.length;i++) {
if (typeof eval(things[i]) != 'undefined'){
console.log(things[i] + ' loaded!');
} else { setTimeout('waitForLoadThen("'+ what.toString()+'")', 100); return false; }
}
return eval(what);
},
// DeepGet
let resp = {
collection: [
{
name: 'batman',
metadata: {
rating: 'PG-14',
year: 1985
}
},
/****
* Inmediate Function scopes the Application to prevent variable pollution
* @param: {Object} global , Reference of the global object
* @param: {Obejct} FWK , Custom framework
*/
;(function (global, FWK, Node) {
'use strict';
// Defining global constants for the app
FWK.const('RANGE_MINUTES' , 720); // Range minutes from 0 to 720
@AMSTKO
AMSTKO / toyjs.js
Created June 22, 2012 12:11
toyjs.js
/*
* ToyFW
* 1.11217.003
*/
module.exports = (function() {
var fs = require('fs'),
path = require('path'),
//
// Graphic Novelist (graphic-novelist.js)
// Created by M@ McCray
// site: http://mattmccray.com
// email: matt at elucidata dot net
//
// API:
//
// GraphicNovelist.parse( text ) -> Parse text into array of script Nodes
// GraphicNovelist.renderNodes( nodes ) -> Renders array of script Nodes into HTML
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<style type="text/css">
tr.had { color: #888; }
</style>
<script type="text/html" id="beer_row">
<% var d = new Date(obj.updated * 1000); now = new Date(); %>
<tr <%= (Beerradar.myRatings.indexOf(parseInt(obj.beer.ratings[0].id)) > -1) ? 'class="had"' : '' %>>
<td><%= Math.round((now.getTime() - d.getTime()) / 86400000) %> days</td>
/**
* Adapted from the official plugin text.js
*
* Uses UnderscoreJS micro-templates : http://documentcloud.github.com/underscore/#template
* @author Julien Cabanès <julien@zeeagency.com>
* @version 0.2
*
* @license RequireJS text 0.24.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
@whiteinge
whiteinge / base.js
Created July 5, 2012 20:10
A baseline JS toolbox for new projects
/**
* Allow Prototypal inheritance
* http://javascript.crockford.com/prototypal.html
* @author Douglas Crockford
* @version 2008-04-07
* @param oldObject
* @return newObject
*/
if (typeof Object.create !== 'function') {
Object.create = function (o) {
@gustinmi
gustinmi / jstemplates2.html
Last active April 26, 2024 08:50
JavaScript Templating Full Edition (settings, localization, micro templates )
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>templator2</title>
<style type="text/css">
html, body {
font-size: 14px;
@lindenb
lindenb / Delicious2Diigo.java
Created December 19, 2010 14:48
Save bookmarks from delicious to Diigo.com using the Diigo API.
/**
* Delicious2Diigo
*
* Author:
* Pierre Lindenbaum
* http://plindenbaum.blogspot.com
*
* Motivation:
* save bookmarks from delicious to diigo using the Diigo API.
*