Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| /** @jsx React.DOM */ | |
| var MyComponent = React.createClass({ | |
| render: function() { | |
| // Defaults in case the props are undefined. We'll have a solution for this | |
| // soon that is less awkward. | |
| var perMinute = this.props.perMinute || '-'; | |
| var perDay = this.props.perDay || '-'; | |
| return ( | |
| <div> | |
| <h3>Clickouts</h3> |
| /** @jsx React.DOM */ | |
| var MyRootComponent = React.createClass({ | |
| getInitialState: function() { | |
| return {perMinute: '-', perDay: '-'}; | |
| }, | |
| componentDidMount: function() { | |
| var socket = io.connect(this.props.url); | |
| socket.on('business.clickout', this.setState.bind(this)); | |
| }, | |
| render: function() { |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>| // Pre-requisites: | |
| // 1. Device core plugin | |
| // 2. Splashscreen core plugin (3.1.0) | |
| // 3. config.xml: <preference name="AutoHideSplashScreen" value="false" /> | |
| // 4. config.xml: <preference name="DisallowOverscroll" value="true" /> | |
| function onDeviceReady() { | |
| if (parseFloat(window.device.version) >= 7.0) { | |
| document.body.style.marginTop = "20px"; | |
| // OR do whatever layout you need here, to expand a navigation bar etc |
Press minus + shift + s and return to chop/fold long lines!
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <title>Single-Column Responsive Email Template</title> | |
| <style> | |
| @media only screen and (min-device-width: 541px) { | |
| .content { |
First create global variables (in functions.php or as a mu-plugin):
<?php
/*
* CUSTOM GLOBAL VARIABLES
*/
function wtnerd_global_vars() {| /*! | |
| * gulp | |
| * $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev | |
| */ | |
| // Load plugins | |
| var gulp = require('gulp'), | |
| sass = require('gulp-ruby-sass'), | |
| autoprefixer = require('gulp-autoprefixer'), | |
| cssnano = require('gulp-cssnano'), |