Skip to content

Instantly share code, notes, and snippets.

View ericf's full-sized avatar

Eric Ferraiuolo ericf

View GitHub Profile
@rgrove
rgrove / node-scroll-info.js
Created June 6, 2012 21:35
node-scroll-info.js
/*!
Copyright (c) 2012 Ryan Grove. All rights reserved.
Redistribution and use of this software in source and binary forms, with or
without modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
views : {
GoalListView : {
type : NS.GoalListView,
requires : [ 'Person', 'CategoryList', 'GoalList', 'NoteList' ],
preserve : true
}
},
showGoalView : function(req, res, next) {
this.handleView('GoalListView', req, res, next);
@juandopazo
juandopazo / gist:3117644
Created July 15, 2012 16:29
Express vs YAF

I think the goal should be to replace Express with Y.App. Express does:

  • Routing
  • Redirection
  • Environment configuration
  • View templating and rendering
  • Everything Connect does

Routing and redirection are very much in the scope of Y.Router/Y.App. Environment configuration is in the scope of YUI. View templating and rendering are also covered. Rendering of static files, middleware, logging, caching, cookies, compression, etc are all covered by Connect. So... Shouldn't the goal be to make Y.App work nicely with Connect?

@voidfiles
voidfiles / app_net_grids.md
Created August 15, 2012 19:01
How App.net uses YUI3 grids

How you can create a responsive grid system using YUI3 grids and SASS

This is a quick rundown of how and why we use YUI3 grids at App.net

As far as I can tell there are three types of CSS grids: a static-width pre-defined grid, a flexible-width pre-defined grid, and a generative grid. In the first two grids (pre-defined width), you basically decide how many columns you have across the screen, and then create blocks in any multiple of those. This pattern often looks like "span-4", "span-6", "pull-10", "push-5", etc. You find this style in popular frameworks like Bootstrap and Blueprint.

The third way, the generative/recursive grid system, doesn't seem to be as popular as the others. I am not entirely sure why, because the generative grid can pack more punch in less lines. In this vein is there is OOCSS and YUI3 CSS Grids.

@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)
@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();
@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.
/*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'),
@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) {
@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.