- Mac OS X Mountain Lion (10.8.2)
- Homebrew
- readline
- rbenv
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
AsyncProcess = require('./async-process').AsyncProcess | |
describe('AsyncProcess', function() { | |
var asyncProcess; | |
beforeEach(function() { | |
asyncProcess = new AsyncProcess(); | |
}); | |
it('should process 42', 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
!!! 5 | |
%html | |
%head | |
%title Example HAML | |
/[if IE] | |
%link{ :rel => "stylesheet", :href => "/css/ie.css" } | |
%body | |
#container | |
%header | |
%h1 Our Awesome HTML5 Template |
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> | |
<head> | |
<title>Treebook</title> | |
<%= stylesheet_link_tag "application", :media => "all" %> | |
<%= javascript_include_tag "application" %> | |
<%= csrf_meta_tags %> | |
</head> | |
<body> | |
<div class="navbar navbar-fixed-top"> |
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
license: gpl-3.0 |
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
if ( ![].fill) { | |
Array.prototype.fill = function( value ) { | |
var O = Object( this ); | |
var len = parseInt( O.length, 10 ); | |
var start = arguments[1]; | |
var relativeStart = parseInt( start, 10 ) || 0; | |
var k = relativeStart < 0 | |
? Math.max( len + relativeStart, 0) | |
: Math.min( relativeStart, len ); |
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
/** | |
* | |
* PATCH to make React work with custom attributes. | |
* | |
*/ | |
HTMLDOMPropertyConfig.isCustomAttribute = function(attr) { | |
// Strip off custom attributes React puts for its working. | |
if ({children: 1}[attr]) { return false; } | |
// Take any attribute (with correct syntax) as custom attribute. |
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
/** | |
* Material UI multi select | |
* | |
* Use with: | |
* <MultiSelect fullWidth={true} value={this.state.values} onChange={(e,v) => this.setState({values: v})}> | |
* <ListItem primaryText={"Option 1"} value={1} /> | |
* <ListItem primaryText={"Option 2"} value={2} /> | |
* <ListItem primaryText={"Option 3"} value={3} /> | |
* <ListItem primaryText={"Option 4"} value={4} /> | |
* </MultiSelect> |
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
import { Component, createElement } from 'react' | |
export default function asyncComponent (getComponent) { | |
return class AsyncComponent extends Component { | |
static NextComponent = null; | |
state = { NextComponent: AsyncComponent.NextComponent } | |
componentWillMount = async () => { | |
if (this.state.NextComponent) { | |
return |
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
// "October 5, 2016" | |
(new Date()).toLocaleString('en-us', {month: 'long', day: 'numeric', year: 'numeric'}); | |
new Intl.DateTimeFormat('en-US', { year: 'numeric', month: 'long', day: 'numeric' }).format(new Date()) | |
// "$123.45" | |
Number(123.45).toLocaleString('en-us', { style: 'currency', currency: 'USD' }); | |
new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(123.45); |
OlderNewer