Go to http://astexplorer.net/, select babylon6 as the parser, and babelv6 as the transform option.
Paste in the babel-plugin-react-string.js
code in the transform area.
Paste the following example source code:
function profile(props) {
CLOSURE_COMPILER_VERSION := 20180101 | |
CLOSURE_COMPILER_URL := http://dl.google.com/closure-compiler/compiler-$(CLOSURE_COMPILER_VERSION).tar.gz | |
closure-compiler: | |
mkdir -p vendor | |
curl -o vendor/closure-compiler.tar.gz $(CLOSURE_COMPILER_URL) | |
tar -C vendor/ -zxf vendor/closure-compiler.tar.gz | |
mv vendor/closure-compiler-v$(CLOSURE_COMPILER_VERSION).jar vendor/closure-compiler.jar | |
rm vendor/COPYING vendor/README.md vendor/closure-compiler.tar.gz | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
module Main where | |
import Data.Monoid ((<>)) | |
import qualified Data.Text as T | |
import Text.Shakespeare.I18N (mkMessage, renderMessage, RenderMessage()) |
// Resolving a deferred created by AngularJS' $q, in an async function outside of Angular (ex: setTimeout) | |
// | |
// See: | |
// https://github.com/angular/angular.js/wiki/When-to-use-$scope.$apply() | |
// http://stackoverflow.com/questions/16066170/angularjs-directives-change-scope-not-reflected-in-ui/16066306#16066306 | |
// https://github.com/angular/angular.js/blob/master/src/ng/timeout.js | |
// Using AngularJS' $q (1.0.7) | |
function testDeferredAngularSync() { | |
var deferred = $q.defer(); |
Go to http://astexplorer.net/, select babylon6 as the parser, and babelv6 as the transform option.
Paste in the babel-plugin-react-string.js
code in the transform area.
Paste the following example source code:
function profile(props) {
var gulp = require('gulp'); | |
var react = require('gulp-react'); | |
var jshint = require('gulp-jshint'); | |
var cache = require('gulp-cached'); | |
var jsFiles = [ | |
'src/**/*.js', | |
'test/**/*.js', | |
'*.js' | |
]; |
// We can mentally separate "core state" from "derived state". | |
// Core state is where you can put normalized data (for relational data): | |
// it is the "single source of truth". | |
// Derived state is where you shape the core state into a representation that's | |
// closer to what you need in your views and components. | |
var coreState = { | |
venuesById: { | |
'v1': {id: 'v1', name: 'Hipster Coffee House'}, | |
'v2': {id: 'v2', name: 'Veggies For Everyone'} |
# avoid "works on my machine" by always locking dependency versions | |
npm config set save-exact=true | |
# install/uninstall project packages with flags that will update package.json | |
npm install --save lodash | |
npm install --save-dev jshint | |
npm uninstall --save lodash | |
# tool that makes upgrading dependencies easier, install it globally | |
npm install -g david |
$ mix deps | |
* fs 0.9.1 (Hex package) (rebar) | |
locked at 0.9.2 (fs) | |
ok | |
* gettext 0.9.0 (Hex package) (mix) | |
locked at 0.9.0 (gettext) | |
ok | |
* ranch 1.2.1 (Hex package) (rebar) | |
locked at 1.2.1 (ranch) | |
ok |
// Exploring using "expose React component tree as data" @swannodette | |
// (https://www.youtube.com/watch?v=5hGHdETNteE#t=1559) | |
// for routing and fetching data ("react-router-mega-demo" @ryanflorence) | |
// (https://github.com/rackt/react-router-mega-demo/blob/master/app/utils/fetchData.js) | |
var appState = { | |
route: '/contacts', | |
contacts: [], | |
messages: [] | |
}; |
/* Ink file picker encoded security policy and its signature with Node.js | |
https://www.inkfilepicker.com/ | |
https://developers.inkfilepicker.com/docs/security/ | |
Usage: | |
ink.encodePolicy({ | |
handle: 'KW9EJhYtS6y48Whm2S6D', | |
expiry: 1508141504 |