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> | |
<meta name="description" content="Responsive Layout"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Responsive Layout (3-col -> mobile)</title> | |
</head> | |
<body> | |
<div class="wrapper"> |
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 React, { Component, PropTypes } from 'react'; | |
import Modal from 'react-modal'; | |
/* | |
@desc: wraps any component provided in a react-modal | |
@param: ModalContent - any React component that you want as a modal | |
@param: Trigger (optional) - a clickable component that will trigger the modal to open | |
@param: triggerProps (optional) - some data to provide to the trigger component | |
@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
// inline event handler which invokes callback prop | |
const UsingAnInlineFunction = ({ | |
itemId, | |
itemName, | |
itemCount, | |
onClick | |
}) => ( | |
<div onClick={() => onClick(itemId)}> | |
<span>{`${itemCount}x ${itemName}`}</span> | |
</div> |
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 Modal = React.createClass({ | |
getInitialState() { | |
return { | |
text: this.props.text | |
}; | |
}, | |
onChange(e) { | |
this.setState({text: e.target.value}); | |
}, | |
closeModal() { |
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
.disable-hover, | |
.disable-hover * { | |
pointer-events: none !important; | |
} |
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
function scrollTo(X, duration, easingFunction, callback) { | |
callback = callback || function () {}; | |
var start = Date.now(), | |
elem = document.scrollLeft ? document : document.body, | |
from = elem.scrollLeft; | |
if (from === X) { | |
callback(); | |
return; /* Prevent scrolling to the X point if already there */ |
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 amqpconnection = amqp.createConnection({url: config.CLOUD_AMQP}, connOptions); | |
amqpconnection.on('ready', function() { | |
// dead letter exchange for rejected messages | |
amqpconnection.exchange( | |
deadLetterExchange, | |
options = {durable: true, autoDelete: false, type: 'topic'}, | |
function (ex) { | |
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 environment = process.env.NODE_ENV || ''; | |
var amqp = require('amqp'), | |
router = require('./routing/messagerouter'), | |
routes = require('./routing/routes'), | |
config = require('./config_' + environment); | |
var amqpconnection = amqp.createConnection({ | |
url: config.CLOUD_AMQP | |
}); |
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 environment = process.env.NODE_ENV || ''; | |
var config = require('../config_' + environment), | |
routes = require('./routes'), | |
EventEmitter = require('events').EventEmitter, | |
messagerouter = {}, | |
topic; | |
var emitter = new EventEmitter(); |
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 visit = require('../eventhandlers/visithandler'), | |
click = require('../eventhandlers/clickhandler'); | |
var routes = { | |
'Visit': visit.log, | |
'Click': click.log | |
}; | |
module.exports = routes; |
NewerOlder