This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NameVirtualHost *:80 | |
<Virtualhost *:80> | |
VirtualDocumentRoot "/Users/Joe/Sites/%1" | |
ServerName vhosts.dev | |
ServerAlias *.dev | |
UseCanonicalName Off | |
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon | |
ErrorLog "/Users/Joe/Sites/vhosts-error_log" | |
<Directory "/Users/Joe/Sites/*"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////////// | |
// Example of how to use this mixin.... | |
// - Think of UI components that can | |
define( | |
['flight/lib/component', 'mixins/with_set_cache'], | |
function(defineComponent, withSetCache, _) { | |
return defineComponent(myComponent, withSetCache); | |
function myComponent() { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
React.if = function(cond, trueCallback, falseCallback) { | |
if(cond && typeof trueCallback === 'function') { | |
return trueCallback(); | |
} | |
else if(!cond && typeof falseCallback === 'function') { | |
return falseCallback(); | |
} | |
}; | |
// Example usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var WithOutlets = { | |
componentWillMount: function() { | |
this.setOutlets(this.props); | |
}, | |
componentWillUpdate: function(nextProps) { | |
if(!nextProps || this.props.children !== nextProps.children) { | |
this.setOutlets(nextProps); | |
} | |
}, | |
setOutlets: function(props) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>App</title> | |
<style> | |
*, *:before, *:after { margin: 0; padding: 0; box-sizing: border-box; } | |
</style> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name="useTheFormNameAttributeAsAnObject" ng-submit="useTheFormNameAttributeAsAnObject.$valid && myCtrl.whatevs(whereDidThisValueComeFrom)"> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.module { | |
some: stuff; | |
&__child { | |
blah: blah; | |
} | |
&--modifier { | |
modify: me; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var Router = require('react-nested-router'); | |
var Route = Router.Route; | |
var Sub = React.createClass({ | |
render: function() { | |
console.log(this.props.myData); | |
return React.DOM.span(null, 'Should this.props.myData be changing?'); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @jsx React.DOM | |
*/ | |
var React = require('react'); | |
var App = require('components/App/App.jsx'); | |
var Layout = React.createClass({ | |
render: function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Improved on react/lib/cx.js | |
// by supporting nested arrays to allow for dynamic keys | |
function cx(classNames) { | |
if(classNames instanceof Array) { | |
var filteredClasses = []; | |
classNames.forEach(function(className, i) { | |
if(typeof className === 'string') { | |
filteredClasses.push(className); | |
} |