Skip to content

Instantly share code, notes, and snippets.

marc 56480 248.1 0.9 5001256 217992 s000 R 5:10pm 0:04.45 /usr/bin/java -Xms256m -Xmx1g -Xss256k -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Delasticsearch -Des.path.home=/usr/local/Cellar/elasticsearch/1.3.3 -cp :/usr/local/Cellar/elasticsearch/1.3.3/libexec/elasticsearch-1.3.3.jar:/usr/local/Cellar/elasticsearch/1.3.3/libexec/*:/usr/local/Cellar/elasticsearch/1.3.3/libexec/sigar/* org.elasticsearch.bootstrap.Elasticsearch
marc 51701 0.0 0.7 5009052 186700 s000 S 3:01pm 0:21.48 /usr/bin/java -Xms256m -Xmx1g -Xss256k -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Delasticsearch -Des.path.home=/usr/local/Cellar/elasticsearch/1.3.3 -cp :/usr/local/Cellar/elasticsearch/1.3.3/li
module Mermaid
module DeliveryHelper
cached = expensive_function_that_i_dont_want_to_run_each_time(params
def method_one
cached[:title]
end
def method_two
cached[:iso]
@mrcthms
mrcthms / .bash_profile
Created August 25, 2016 13:04
Easier component-specific Enzyme testing
function enzyme() {
mocha --grep $1 src/**/*.spec.js
}
@mrcthms
mrcthms / react.js
Last active November 23, 2016 15:00
import React from 'react';
export const Nav = React.createClass({
componentDidMount: function () {
analytics.track('Nav Mounted');
},
handleLogoClick: function (evt) {
evt.preventDefault();
analytics.track('Logo Clicked');
},
import React from 'react';
import PropTypes from 'prop-types';
import './Badge.css';
const Badge = ({ withHeading, heading, children }) => (
<div className="badge">
{withHeading && (
<span className="badge-heading">{heading}</span>
)}
{children}
import React from 'react';
import Badge from './components/Badge';
import './App.css';
const App = props => (
<div className="app">
<Badge
withHeading
heading="Hello Darkness">
My Old Friend
import React from 'react';
import './Table.css';
const Table = ({ propTypes }) => (
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required?</th>
import React from 'react';
import Badge from './components/Badge';
import Table from './ui/Table';
import './App.css';
const App = props => (
<div className="app">
<Badge
withHeading
heading="Hello Darkness">
// import this to check each of the component's PropTypes against
import PropTypes from 'prop-types';
// helper method to determine whether a propType method is a particular PropType validator
const isCorrectPropType = (method, propType) =>
method === PropTypes[propType] || method === PropTypes[propType].isRequired;
// helper method to determine whether a prop is required or not - if it is required,
// it'll be equal to the .isRequired method on the propType.
const isPropTypeRequired = (method, propType) => method === PropTypes[propType].isRequired;
import React from 'react';
import PropTypes from 'prop-types';
import './Table.css';
const getRows = propTypes => Object.keys(propTypes).map(prop => (
<tr key={prop}>
<td>{prop}</td>
<td>{propTypes[prop].type}</td>
<td>{propTypes[prop].required.toString()}</td>
</tr>