This file contains 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 node | |
var capitalize = require("../main.js"); | |
var value = process.argv[2]; | |
console.log(capitalize.capitalize(value)); |
This file contains 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 node | |
var capitalize = require("../main.js"); | |
var value = process.argv[2]; | |
console.log(capitalize.decapitalize(value)); |
This file contains 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
{ | |
"author": "robert kuzelj <robert@capitalize.org>", | |
"name": "capitalize", | |
"description": "capitalizes and decapitalizes a string", | |
"version": "0.3.0", | |
"homepage": "www.capitalize.org", | |
"repository": | |
{ | |
"url": "" | |
}, |
This file contains 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
{ | |
... | |
"version": "0.3.0", | |
... | |
"bin" : | |
{ | |
"cap" : "./bin/cap.js", | |
"ccap": "./bin/ccap.js", | |
"dcap": "./bin/dcap.js" | |
} |
This file contains 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
{ | |
... | |
"version": "0.4.0", | |
... | |
"bin" : | |
{ | |
"cap" : "./bin/cap.js", | |
"ccap": "./bin/ccap.js", | |
"dcap": "./bin/dcap.js", | |
"coffee": "./bin/dcap.js" |
This file contains 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
get = "get" | |
set = (value) -> value | |
class Grid | |
@new: (x, y, val = 0)-> | |
item = new Grid x, y, val | |
(x, y) -> | |
(value) -> | |
if value == get | |
return item.grid[x][y] |
This file contains 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
class Grid | |
@new: (x, y = 1, dval = 0)-> | |
item = new Grid x, y, dval | |
(x, y) -> | |
(value) -> | |
v = value() | |
if v is undefined | |
return item.grid[x][y] | |
else | |
item.grid[x][y] = v |
This file contains 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
# very simple, very clear. If need to be changed, changes in two places | |
func: (data)=> | |
if data.x % @TILE_SIZE == 0 | |
@x = Math.floor(data.x / @TILE_SIZE) | |
if data.y % @TILE_SIZE == 0 | |
@y = Math.floor(data.y / @TILE_SIZE) | |
# easier to change BUT intention not so clear anymore | |
# and also longer and took longer to write | |
func: (data)=> |
This file contains 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
foo = (param1)-> | |
(param2)-> | |
param1 + param2 | |
foo(1)(2) |
This file contains 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
class A | |
class B | |
# packages and their artifacts must be defined as object literals | |
window.foobaz = { | |
A | |
B | |
} |