npm install babel-loader imports-loader webpack --save
- Create
webpack.config.js
- Move
index.ios.js
tosrc/index.ios.jsx
webpack --watch
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
machine: | |
php: | |
version: 5.6.5 | |
dependencies: | |
cache_directories: | |
- vendor | |
- node_modules | |
pre: | |
- sudo pip install awscli |
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
class myDirective { | |
constructor(userService) { | |
this.template = `<div>{{fullName}}</div>`; | |
this.restrict = 'E'; | |
this.scope = { | |
user: '=' | |
}; | |
this.link = function(scope, element) { | |
scope.fullName = userService.getFullName(scope.user); | |
}; |
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 fs = require('fs'); | |
var util = require('util'); | |
var request = require('request'); | |
var clientId = 'test-app'; // Can be anything | |
var clientSecret = 'f6f0bfec08274b8790520a9079b808af'; // API key from Azure marketplace | |
var str = 'This is a cool demo to call Microsoft text to speach service in Node.js.'; | |
console.log('Converting from text -> speech -> text.'); |
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 './login.styl'; | |
import Component from '../components/component.react'; | |
import React from 'react'; | |
import exposeRouter from '../components/exposerouter.react'; | |
import {focusInvalidField} from '../lib/validation'; | |
@exposeRouter | |
export default class Login extends Component { | |
static propTypes = { |
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
// How to get the pickadate to mount correcty in React.js component | |
// requires jQuery and pickadate.js (https://github.com/amsul/pickadate.js/) | |
var Component = React.createClass({ | |
getInitialState: function() { | |
return ({value: null}); | |
}, | |
componentDidMount: 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
import React from 'react'; | |
import axios from 'axios'; | |
import Rx from 'rxjs'; | |
export default class App extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
scores: [] | |
}; |
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
#!/usr/bin/env bash | |
# Copy the url of the active ngrok connection to the clipboard. | |
# Usage: | |
# ngrok-copy # copies e.g. https://3cd67858.ngrok.io to clipboard. | |
# ngrok-copy -u # copies e.g. http://3cd67858.ngrok.io to clipboard. | |
if [[ "$1" == "-u" ]]; then | |
NGROK_URL=`curl -s http://127.0.0.1:4040/status | grep -P "http://.*?ngrok.io" -oh` | |
else | |
NGROK_URL=`curl -s http://127.0.0.1:4040/status | grep -P "https://.*?ngrok.io" -oh` |
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
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 ReactDOMServer = require('react-dom/server'); | |
var cheerio = require('cheerio'); | |
module.exports = function( reactClass ) { | |
var staticMarkup = ReactDOMServer.renderToStaticMarkup(reactClass); | |
var $ = cheerio.load(staticMarkup); | |
return $.root().children().first(); | |
}; |