Skip to content

Instantly share code, notes, and snippets.

View brianswisher's full-sized avatar

Brian Swisher brianswisher

View GitHub Profile
<!doctype html>
<html ng-app="Demo" ng-controller="AppController">
<head>
<meta charset="utf-8" />
<title>Creating A Custom "Show" Directive In AngularJS</title>
<style type="text/css">
ul {
@brianswisher
brianswisher / proxy-url.js
Created May 20, 2013 16:58
Bare bones NodeJs url proxy
var sys = require('sys'),
http = require('http'),
url = require('url');
function notFound(res) {
res.writeHead(404, "text/plain");
res.end("404: File not found");
}
http.createServer(function(b_req, b_res){
@brianswisher
brianswisher / proxy-pipe.js
Last active December 17, 2015 13:10
Simple pipe driven proxy server
#!/usr/bin/env node
var sys = require('sys'),
url = require('url'),
http = require('http'),
port = 9000,
acceptor = http.createServer().listen(port),
host = process.argv[2] || 'localhost';
acceptor.on('request', function(request, response) {
**jQuery** - We can eliminate jQuery on the UHP, but it would require reworking several other behaviors on the page, the big one being the StartEndDate selector.
**StartEndDateSelector** - Devices provide their own standard UI for date selection with full support for localization. Overriding this free UI for everybody is no small task and seems extraneous. We should try to support native date selection with an adaptive polyfill for those that need it. To be considered:
* The RFC 3339/ISO 8601 "wire format": YYYY-MM-DD. According to the HTML5 specification, this is the format that must be used for the input's value upon form submission or when requested via the DOM API. It is locale and region independent.
**System libs** - There are some we can potentially optimize for mobile
* OpinionLab
* Omniture
* ...
// shim layer with setTimeout fallback
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
function( callback ){
window.setTimeout(callback, 1000 / 60);
};
})();
(3m) - head count (math to determine cake size)
(3m) - estimate on who will have seconds (math to determine cake size)
(30m) - finalize frosting based copy
(3m) - flavor (identify cake attributes)
(3m) - frosting (identify cake attributes)
(3m) - filling (identify cake attributes)
(3m) - plates (identify cake utensils)
(3m) - forks (identify cake utensils)
(3m) - napkins (identify cake utensils)
(1m) - knife for slicing (identify cake utensils)

Prototype Tools

System dependancies

win - cmd.exe | mac - Terminal.app

*Install latest versions for all

NodeJs - accept installer defaults


System dependancies

win - cmd.exe | mac - Terminal.app

*Install latest versions for all

/** @jsx React.DOM */
React.createClass({
render:function(){
return (
<div>
<a href="#"></a>
// React.DOM.a( {href:"#"})
</div>
)
}
@brianswisher
brianswisher / dynamic_scripts.js
Last active December 4, 2015 15:29
Dynamic script loader
(() => {
const libs = [
"https://cdnjs.cloudflare.com/ajax/libs/superagent/1.2.0/superagent.min.js",
"https://cdnjs.cloudflare.com/ajax/libs/ramda/0.18.0/ramda.min.js"
].map((src) => {
return new Promise(resolve => {
const script = document.createElement("script");
script.src = src;
script.async = false;
script.onload = () => {