apply()
,call()
の理解が足りない。
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
[submodule "lib/normalize.css"] | |
path = lib/normalize.css | |
url = git://github.com/necolas/normalize.css.git |
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
fs = require('fs') | |
{print} = require('util') | |
{spawn} = require('child_process') | |
build = (callback) -> | |
coffee = spawn('coffee', ['-c', '-o', './js', './js']) | |
jade = spawn('jade', ['-P', '-O', './', './']) | |
stylus = spawn('stylus', ['./css']) | |
coffee.stderr.on 'data', (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
fs = require('fs') | |
{print} = require('util') | |
{spawn} = require('child_process') | |
build = (callback) -> | |
coffee = spawn('coffee', ['-c', '-o', './js', './js']) | |
jade = spawn('jade', ['-P', '-O', './', './']) | |
stylus = spawn('stylus', ['./css']) | |
coffee.stderr.on 'data', (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
# | |
# My Cakefile | |
# written by [Yu Inao](http://twitter.com/japboy) | |
# updated on 2013-01-25 | |
# TODO: Add YUIDoc for documentation | |
http = require 'http' | |
fs = require 'fs' | |
path = require 'path' |
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
!!! 5 | |
html(lang='ja-JP') | |
head | |
meta(charset='UTF-8') | |
meta(http-equiv='X-UA-Compatible', content='IE=edge,chrome=1') | |
block head-title | |
meta(name='viewport', content='width=device-width') | |
meta(name='author', content='Yu Inao') | |
meta(name='rights-standard', content='pd') | |
block head-meta |
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 coffee --bare | |
# Put `chmod +x ./web.coffee` and run `./web.coffee` | |
http = require 'http' | |
http.createServer (request, response) -> | |
response.writeHead 200, { 'Content-Type': 'text/plain' } | |
response.end 'Hello World\n' | |
.listen 8124 |
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
/*! | |
* CSS Ajax-loader | |
* =============== | |
* | |
* Written by Yu Inao, distributed under Public Domain. | |
* | |
* Usage | |
* ----- | |
* | |
* #element { |
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
#!/bin/sh | |
# Change file permission recursively | |
find /path/to/dir -type f | xargs chmod 644 | |
# Or this is also same as above | |
find /path/to/dir -type f -exec chmod 644 {} \; | |
# Or change file and directory permission recursively and appropriately | |
# 644 for files, and 755 for directories |
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 coffee --bare | |
# Extend Array to add shuffle method | |
Array::shuffle = -> | |
d = @length | |
while d | |
n1 = Math.floor(Math.random() * d) | |
n2 = @[--d] | |
@[d] = @[n1] | |
@[n1] = n2 |