- chrome://gpu
- chrome://flags
- Flags
- --start-fullscreen
- --kiosk
| export function coordinateToPosition(lat, lng, radius) { | |
| const phi = (90 - lat) * DEGREE_TO_RADIAN; | |
| const theta = (lng + 180) * DEGREE_TO_RADIAN; | |
| return new THREE.Vector3( | |
| - radius * Math.sin(phi) * Math.cos(theta), | |
| radius * Math.cos(phi), | |
| radius * Math.sin(phi) * Math.sin(theta) | |
| ); | |
| } |
| import * as THREE from 'three'; | |
| import { geoInterpolate } from 'd3-geo'; | |
| const GLOBE_RADIUS = 200; | |
| const CURVE_MIN_ALTITUDE = 20; | |
| const CURVE_MAX_ALTITUDE = 200; | |
| const DEGREE_TO_RADIAN = Math.PI / 180; | |
| export function clamp(num, min, max) { | |
| return num <= min ? min : (num >= max ? max : num); |
| /** | |
| * braces/brackets/parentheses validator | |
| */ | |
| function check(str) { | |
| const closers = { | |
| ')' : '(', | |
| '}' : '{', | |
| ']' : '[' | |
| }; | |
| const openers = { |
| # simple php server to serve adminer | |
| php -S localhost:8000 |
| // children propType | |
| Foo.propTypes = { | |
| children: PropTypes.oneOfType([ | |
| PropTypes.arrayOf(React.PropTypes.node), | |
| PropTypes.node | |
| ]) | |
| } | |
| // use react router in a component (if you have to) | |
| import withRouter from 'react-router/lib/withRouter'; |
| # create local branch (shorthand) | |
| git checkout -b <branch_name> | |
| # create local branch | |
| git branch <branch_name> | |
| git checkout <branch_name> | |
| # and then start hacking and commit | |
| # push branch to remote |
| # Serve static SPA | |
| server { | |
| listen 80; | |
| root /home/young/src/www.example.com/; | |
| index index.html; | |
| server_name www.example.com; | |
| location / { |
| # delete all locally missing files | |
| svn st | grep ^! | awk '{print " --force "$2}' | xargs svn rm | |
| # add all unversioned files to SVN | |
| svn add --force * --auto-props --parents --depth infinity -q | |
| # edit a ignore list on this folder | |
| svn propedit svn:ignore . |