start new:
tmux
start new with session name:
tmux new -s myname
| import React from "react"; | |
| import { render } from "react-dom"; | |
| const ParentComponent = React.createClass({ | |
| getDefaultProps: function() { | |
| console.log("ParentComponent - getDefaultProps"); | |
| }, | |
| getInitialState: function() { | |
| console.log("ParentComponent - getInitialState"); | |
| return { text: "" }; |
| // Generates a URL-friendly "slug" from a provided string. | |
| // For example: "This Is Great!!!" transforms into "this-is-great" | |
| function generateSlug (value) { | |
| // 1) convert to lowercase | |
| // 2) replace anything that's not an alphanumeric character or dash with a dash | |
| // 3) replace instances of more than one dash with a single dash | |
| // 4) remove leading and trailing dashes | |
| return value.toLowerCase().replace(/[^a-z0-9-]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, ''); | |
| }; |