Skip to content

Instantly share code, notes, and snippets.

View ericf's full-sized avatar

Eric Ferraiuolo ericf

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.4.2/pure-min.css">
</head>
<body>
<div class="pure-g">
@ericf
ericf / CSP + SPDY Push.md
Last active August 29, 2015 14:05
CSP + SPDY Push

SPDY Push for Externalizing Dynamic Inline Scripts for CSP

This is a rough outline of some thoughts on how to leverage [SPDY Push][SPDY] externalize inline <script>s that contain dynamic, page/user-specific configuration and state data to align with [CSP][].

Problem

We are building web apps where the initial rendering (HTML) is built server-side, and in order for the client-side JavaScript app to take over, the app's configuration and initial state are written to an inline <script> element.

YUI().use("node", "compat", function(Y){
Y.Lang.isValue( YAHOO && YAHOO.util.Dom && YAHOO.util.Event ) // true
});
<html>
<head><title>testing gist</title></head>
<body>
<script type="text/javascript" src="http://gist.github.com/raw/68197/0599a2f57e5626b606a35bd0e65136da2e1742f0/test.js"></script>
<script type="text/javascript" src="http://gist.github.com/raw/68197/49951505cda6e4d30c49ffd387f0e4464a2bb437/test2.js"></script>
</body>
var lis = Y.all('#test li'), index = 0;
lis.each(function(li){
Y.log( index );
Y.log( lis.item(index).compareTo(li) ); // true
index ++;
});
/**
* SimpleTabs
* Eric Ferraiuolo — http://eric.ferraiuolo.name
*/
var SimpleTabs,
SIMPLETABS = 'simpletabs',
BOUNDING_BOX = 'boundingBox',
CONTENT_BOX = 'contentBox',
/**
* Overlay Modal Extension
*
* Oddnut Software
* Copyright (c) 2009 Eric Ferraiuolo - http://eric.ferraiuolo.name
* MIT License - http://www.opensource.org/licenses/mit-license.php
*/
var Modal,
YUI.add('overlay-modal', function(Y) {
/**
* Overlay Modal Extension
*
* Oddnut Software
* Copyright (c) 2009 Eric Ferraiuolo - http://eric.ferraiuolo.name
* MIT License - http://www.opensource.org/licenses/mit-license.php
*/
YUI().use('overlay', 'overlay-modal', function(Y){
var FancyOverlay = Y.Base.build('fancyoverlay', Y.Overlay, [Y.OverlayModal]);
var myFancyOverlay = new FancyOverlay({
modal : true,
mask : true,
centered : true,
width : 500
height : 300
YUI.add('logismo', function(Y) {
/**
* Logismo
*/
var Logismo,
LOGISMO = 'logismo',
EVENTS_RESOURCE_PATH = 'eventsResourcePath',