This file contains hidden or 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 PropTypes from 'prop-types'; | |
| const SegmentedControl = ({ input, disabled, heading, required, className, items, name, meta: { touched, error } }) => ( | |
| <div className="field"> | |
| <div className="control"> | |
| <div className="help">{heading} {required ? (<span className="help inline is-danger">*</span>) : null}</div> | |
| { items.map((item, i) => ( | |
| <label className="radio m-r-2" key={ i }> |
This file contains hidden or 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 game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create }); | |
| var emitter; | |
| function preload() { | |
| game.load.image('diamond', 'assets/sprites/diamond.png'); | |
| } |
This file contains hidden or 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
| open -a Google\ Chrome --args --disable-web-security |
This file contains hidden or 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
| <my-widget> | |
| <p>This is my paragraph text.</p> | |
| </my-widget> | |
| var app = angular.module("MyApp", []); | |
| app.directive("myWidget", function() { | |
| return { | |
| restrict: "E", | |
| transclude: true, | |
| template: "<h3>Heading</h3>" |
This file contains hidden or 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 host = window.location.hostname; | |
| var port = 3001; | |
| var serverAddress = host + ":" + port; | |
| console.log('serverAddress:' + serverAddress); | |
| var websocket = new WebSocket("ws:" + serverAddress); | |
| websocket.onmessage = function(message){ | |
| console.log('onmessage: ', message); | |
| if(message.data === "jump"){ |
This file contains hidden or 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
| window.App.webSocketServer = {}; | |
| var PORT = 3001; | |
| var socketServer = new monaca.WebSocketServer(PORT); | |
| socketServer.onClientConnected = function(client){ | |
| App.trigger('client:connected', client); | |
| }; | |
| socketServer.onClientDisconnected = function(client){ |
This file contains hidden or 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
| window.App.httpServer = {}; | |
| var PORT = 3000; | |
| var ROOT_DIRECTORY = "client/" | |
| var httpServer = new monaca.HttpServer(ROOT_DIRECTORY, PORT); | |
| App.httpServer.start = function(){ | |
| httpServer.start(function(response){ | |
| App.trigger('httpServer:started', response); |
This file contains hidden or 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
| Application = function(){}; | |
| Application.prototype = new EventDispatcher(); | |
| window.App = new Application(); |
This file contains hidden or 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
| <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <script src="plugins/plugin-loader.js"></script> | |
| <link rel="stylesheet" href="plugins/plugin-loader.css"> | |
| <script> | |
| var PORT = 3000; | |
| var ROOT_DIRECTORY = "client/" | |
This file contains hidden or 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
| /* source: | |
| Martin Jespersen | |
| http://stackoverflow.com/questions/4671031/print-function-log-stack-trace-for-entire-program-using-firebug | |
| */ | |
| function logStackTrace(levels) { | |
| var callstack = []; | |
| var isCallstackPopulated = false; | |
| try { | |
| i.dont.exist += 0; //doesn't exist- that's the point |
NewerOlder