Skip to content

Instantly share code, notes, and snippets.

@d48
d48 / readme.md
Created September 21, 2017 17:35
testing details

Overview

testing details

Testing this out How does it work
@d48
d48 / umd-templates.js
Created August 1, 2017 23:25 — forked from mflorida/umd-templates.js
Templates for UMD patterns
/**
* UMD pattern with anonymous function expression
*/
(function(){
var umd = function(factory){
if (typeof exports === 'object') {
return module.exports = factory();
}
else if (typeof define === 'function' && define.amd) {
@d48
d48 / keybase.md
Created February 8, 2017 21:17
d48 keybase proof

Keybase proof

I hereby claim:

  • I am d48 on github.
  • I am d48 (https://keybase.io/d48) on keybase.
  • I have a public key whose fingerprint is 349E 2B0D 38A9 D8B8 2F43 32AE 385B 0BD3 CEC3 B707

To claim this, I am signing this object:

@d48
d48 / keybase.md
Created February 8, 2017 21:09
Keybase proof for d48

Keybase proof

I hereby claim:

  • I am d48 on github.
  • I am d48 (https://keybase.io/d48) on keybase.
  • I have a public key ASB-oO7Tb9KV5ogsq1mUSxVlpbqnjJVxIQb1zVfeqf56IQo

To claim this, I am signing this object:

@d48
d48 / changelog-sample.md
Created February 7, 2017 20:14
sample changelog

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[Unreleased]

Added

  • zh-CN and zh-TW translations from @tianshuo.
  • de translation from @mpbzh.
@d48
d48 / a-createBundles.js
Last active August 29, 2015 14:08
Creating bundles for culture files via Node.js
// get native file system object
var fs = require('fs')
// get a template
, template = fs.readFileSync('./template.txt', 'utf8')
// read files from a directory called '/cultures' for file names, specifically language tag, e.g., 'en-US' or 'fr-FR'
, filesInDir = fs.readdirSync('./cultures/')
// create file handle to output to
, stream = fs.createWriteStream('./bundles.txt')
@d48
d48 / DOMUtils.js
Created March 21, 2014 18:23
API for creating DOM elements with properties. Returns DOM element to append to document
var elInputName = DOMUtil.create({
type: 'input'
, subType: 'textField'
, placeholder: 'Type in your name'
, class: 'myModule--input-name'
, event: {
click: function() { console.log('clicked'); }
, hover: function() { console.log('i am hovered'); }
}
});
@d48
d48 / loud.coffee
Last active December 28, 2015 08:49
loudbot.coffee
# Description:
# Display a random tweet from loudbot if someone YELLS in chat
#
# Dependencies:
# "ntwitter" : "https://github.com/sebhildebrandt/ntwitter/tarball/master",
#
# Configuration:
# HUBOT_TWITTER_CONSUMER_KEY
# HUBOT_TWITTER_CONSUMER_SECRET
# HUBOT_TWITTER_ACCESS_TOKEN_KEY

The game we're building is a simple side-scrolling racing game. The player's car is static on the screen, only the background is moving. The enemies are planes whom the player must dodge using the up and down arrow keys. If the player hits a plane, he dies. One point is given each time a plane goes off screen without touching the player.

Sprites

Our game is composed of sprites. Each sprite has a position (x, y), velocity (speed) and one image, or more if animated.

Images are loaded from the DOM using their CSS selector (imagesSelector). We use ID selectors (#name) for single images and class selectors (.name) for animated sprites composed of several images.

See the images used in the game.

@d48
d48 / bash-description-json.bash
Created June 28, 2013 14:55
bash command to output name and description for list of package.json in 2 directories below
for pkg in `find . -d 2 -name package.json`; do cat $pkg | json name description; echo ""; done