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
const a = { foo: 'foo'}; | |
const b = { bar: 'bar'}; | |
// the wrong way | |
const result = Object.assign(a, b); | |
console.log(a) | |
// { foo: 'foo', bar: 'bar' } | |
// this is usually bad, we usually don't want to mutate `a` in most cases | |
// The right ways: |
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
PS.keyDown = function (key, shift, ctrl, options) { | |
"use strict"; | |
// p was pressed - pause the game | |
if (key === 112) { | |
GAME.paused = !GAME.paused // flip the state, if it was paused, it's unpaused after this | |
PS.debug("Game is now paused: " + GAME.paused); | |
// not sure how PS works. I suspect you don't want to stop the timer here, but instead want to do that in code that is higher up | |
// i would iamgine the game controller would have access to the timer properties | |
} |
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
// npm install browserify -g | |
// npm install tsd -g | |
// npm install react tsify | |
// tsd install react | |
// browserify app.tsx -p [tsify --jsx=react] -o bundle.js | |
/// <reference path="typings/react/react.d.ts" /> | |
import React = require("react"); | |
interface HelloWorldComponentProps extends React.Props<any> { |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |