Skip to content

Instantly share code, notes, and snippets.

View ericf's full-sized avatar

Eric Ferraiuolo ericf

View GitHub Profile
@caridy
caridy / README.md
Last active December 20, 2015 07:19
express-routes-notes

What is this?

This is a prototype for the low-level api to serialize express routes into the client side.

Installation

npm install
node simple.js
node complex.js
@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active April 30, 2024 19:21
5 entertaining things you can find with the GitHub Search API
@caridy
caridy / template-registration.md
Last active December 17, 2015 04:08
Template registration process in YUI

This gist was updated based on the discussion here : https://groups.google.com/forum/?fromgroups=#!topic/yui-contrib/cUpVvtoUBa8

Template Registration

With the ability to precompile templates into javascript and the abtraction layer provided by Y.Template to normalize the api to render those templates, we got one step closer to create applications that can be template language agnostic.

The premise here is to create a YUI Application that references templates by name and call for render when needed without having to know what engine to use, or what file generated the compiled template, or what api should be used for a particular template.

In order to facilitate this, we should have a centralized registration mechanism used by the application to register any template that is provisioned, in which case we can decouple the provisioning process from the actual rendering process.

@juandopazo
juandopazo / gist:5405383
Last active December 16, 2015 08:19
Storage module design and API for review

Storage

Motivation

There are 3 major types of storage is browsers up to date:

  • IndexedDB. The future.
  • localStorage. Limited in size and can be observed through the storage event.
  • WebSQL. Dropped by the W3C but it's still very present in the wild, with notable platforms like iOS and PhoneGap.
@lsmith
lsmith / example.html
Last active December 15, 2015 16:39
WIP IO implementation using transports with send(requestObj, callback(err, data)) and a generic io(requestObj[, callback]) that returns promises.
<!doctype html>
<html>
<head>
<title>IO with transports and promises</title>
</head>
<body>
<script src="http://yui.yahooapis.com/3.9.1/build/yui/yui.js"></script>
<script>
// sm-io is an alias for sm-io-core and sm-io-xhr. The two modules don't require one another.
YUI({ filter: 'raw' }).use('sm-io', function (Y) {
/*jslint node:true*/
'use strict';
var express = require('express'),
mojito = require('mojito-server'),
locator = require('./locator.js'),
config = require('./conf/config'),
middleware = require('./lib/middleware'),
@caridy
caridy / locater.md
Last active December 11, 2015 03:48
Thoughts on YUI Locater

Locater (former ResourceStore in Mojito)

Locater is a filesystem abstraction that is meant to provide access to configurations and resources that describes a YUI App.

The responsibilities of the Locater are:

  • To explore and flatten the structure of a YUI App.
  • To watch and cache meta information to speed up the warm up process for the app.
  • To provide meta information about logical pieces in the application (aka mojits).
  • To provide meta information about specific resorces.
@polotek
polotek / ember_hurdles.md
Last active March 30, 2017 05:37
Hurdles getting started with Ember.js

This is a brain dump of my experience trying to get something going with Ember.js. My goal was to get to know the ins and outs of the framework by completing a pretty well defined task that I had lots of domain knowledge about. In this case reproducing a simple Yammer feed. As of this time, I have not been able to complete that task. So this is a subjective rundown of the things I think make it difficult to get a handle on Ember. NOTE: My comments are addressing the Ember team and giving suggestions on what they could do to improve the situation.

App setup

The new guides have pretty good explanation of the various parts of the framework; routers, models, templates, views. But it's not clear how they all get strapped together to make something that works. There are snippets of examples all over the place like:

App.Router.map(function() {
  match('/home').to('home');
});
@caridy
caridy / perf.js
Created November 20, 2012 23:07
Perf optimization for function hooks in Node.JS
var microtime = require('microtime'),
i,
t,
obj,
max = 10000000;
function run1(obj) {
t = microtime.now();
for (i = 0; i < max; i += 1) {
if (obj.foo) obj.foo();
@davglass
davglass / gist:4019847
Created November 5, 2012 19:38
Dav's Yeti Cluster

Dav's Yeti Cluster

Direct Hardware

  • Ubuntu VM Host
  • 1TB HDD (for OS)