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 Label from './label'; | |
| import Input from './input'; | |
| function Field (props) { | |
| return ( | |
| <div className="form-group"> | |
| <Label>{props.label}</Label> | |
| <Input type={props.type} onChange={props.onChange} value={props.value}/> | |
| </div> |
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
| server.ext('onPreResponse', (request, reply) => { | |
| const response = request.response; | |
| if (response.variety && response.variety === 'view') { | |
| response.source.context = response.source.context || {}; | |
| if (request.auth.isAuthenticated) { | |
| response.source.context.user = { | |
| name: request.auth.credentials.name | |
| }; | |
| } |
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
| 'use strict'; | |
| const Hapi = require('hapi'); | |
| const Joi = require('joi'); | |
| const server = new Hapi.Server(); | |
| server.connection({ port: 3000 }); | |
| server.route({ |
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
| 'use strict'; | |
| const Hapi = require('hapi'); | |
| const server = new Hapi.Server(); | |
| server.connection({ port: 3000 }); | |
| // our route with normal output | |
| server.route({ |
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
| function getComputerChoice() { | |
| var choice = Math.random(); | |
| if (choice < 0.34) { | |
| return "rock"; | |
| } else if(choice <= 0.67) { | |
| return "paper"; | |
| } else { | |
| return "scissors"; | |
| } |
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
| //Author: Adilson Schmitt Junior ,aka SirGallifrey | |
| //This script is just to show how you could resize a objet to fit a orthographic camera fustrum size. | |
| using UnityEngine; | |
| using System.Collections; | |
| public class ScaleObjectToCamera : MonoBehaviour { | |
| public float widthPerc = 1.0f; |
NewerOlder