Skip to content

Instantly share code, notes, and snippets.

View mattcolman's full-sized avatar

Matt Colman mattcolman

View GitHub Profile
@mattcolman
mattcolman / good-bad-js.coffee
Created November 5, 2015 05:31
Good Bad JS Examples (coffeescript)
# ---------------------------------------------------------- #
# EXAMPLE 1
# ---------------------------------------------------------- #
#
# BAD
addPoints: ->
pts = []
for i in [0...100]
pts.push @getRandomPointFromRect new Rectangle(0, i * 20, 20, 20)
@mattcolman
mattcolman / custom_movieclip_loader.js
Last active March 1, 2016 02:48
Custom MovieClip Loader
CustomLoader = function(item) {
this.AbstractLoader_constructor(item, false, 'loader')
}
CustomLoader.getPreloadHandlers = function() {
return {
types: [ 'some_custom_type' ]
callback: CustomLoader.preloadHandler
}
}
@mattcolman
mattcolman / block_diff.jsx
Last active March 26, 2017 04:36
Block diff
function helloWorld() {
return <ShoppingList
name="Sunday Shop"
items={7}
status={2}
/>
}
@mattcolman
mattcolman / semiColonDiff.jsx
Last active March 26, 2017 10:50
Semi-colon diff example
const a = 'a'
const b = 'been'
const c = () => {
return a
}