Skip to content

Instantly share code, notes, and snippets.

View hoorayimhelping's full-sized avatar

Bucky Schwarz hoorayimhelping

View GitHub Profile
@hoorayimhelping
hoorayimhelping / object-assign.js
Created March 2, 2017 18:59 — forked from MrAlexLau/object assign
object.assign vs the spread operator
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:
@hoorayimhelping
hoorayimhelping / Game1.js
Last active September 23, 2015 13:15 — forked from anonymous/Game1
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
}
@hoorayimhelping
hoorayimhelping / app.js
Created September 22, 2015 11:45 — forked from tomaskikutis/app.tsx
react typescript browserify
// 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> {
@hoorayimhelping
hoorayimhelping / hack.sh
Created March 31, 2012 13:12 — forked from erikh/hack.sh
OSX For Hackers
#!/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
#