This file contains hidden or 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
/* need underscore.js */ | |
/** | |
* randomNum | |
* randomNum(3,6); => 4 | |
*/ | |
var randomNum = function(from, to) { | |
return from + Math.floor( Math.random() * (to - from + 1) ); | |
}; |
This file contains hidden or 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
<div class="mod-oremodule"> | |
<div class="mod-oremodule-hd"> | |
<h1>ore module</h1> | |
</div> | |
<div class="mod-oremodule-bd"> | |
<p class="mod-oremodule-bd-p">hogehoge</p> | |
<p class="mod-oremodule-bd-footnote">hogepuyo</p> | |
</div> | |
</div> |
This file contains hidden or 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
$.widget('mod.hoge', { | |
_create: function(){ | |
alert('this method will be called first'); | |
this.method1(); | |
this.method2(); | |
this.method3(); | |
}, | |
method1: function(){ | |
... | |
}, |
This file contains hidden or 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
(function() { | |
var SomeUI; | |
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; | |
SomeUI = (function() { | |
function SomeUI($el) { | |
this.$el = $el; | |
this.$content = $el.find('.content'); | |
this.$button1 = $el.find('.button1'); | |
this.$button2 = $el.find('.button2'); | |
this._eventify(); |
This file contains hidden or 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
{print} = require 'util' | |
{spawn} = require 'child_process' | |
task 'build', 'Build lib/ from src/', -> | |
coffee = spawn 'coffee', ['-c', '-o', 'lib', 'src'] | |
coffee.stderr.on 'data', (data) -> | |
process.stderr.write data.toString() | |
coffee.stdout.on 'data', (data) -> | |
print data.toString() | |
coffee.on 'exit', (code) -> |
This file contains hidden or 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
# ================================================================== | |
# Cakefile - compile, concatenate, minify coffee | |
# ================================================================== | |
# ├─ Cakefile | |
# ├─ lib | |
# │ ├─ all.js | |
# │ └─ all.min.js | |
# └─ src | |
# ├─ fuga.coffee | |
# └─ hoge.coffee |
This file contains hidden or 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
# ================================================================== | |
# Cakefile - compile, concatenate, minify coffee | |
# ================================================================== | |
# ├─ Cakefile | |
# ├─ lib | |
# │ ├─ all.js | |
# │ └─ all.min.js | |
# └─ src | |
# ├─ fuga.coffee | |
# └─ hoge.coffee |
This file contains hidden or 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
var proc = require('child_process'); | |
config.init({ | |
lint: { | |
files : [ 'hoge.js', 'fuga.js' ] | |
}, | |
concat: { | |
'all.js' : [ 'hoge.js', 'fuga.js', 'cofall.js', '_coftemp.js' ] | |
}, |
This file contains hidden or 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
"--------------------------------------------------------------------------- | |
" tab setting toggle macro | |
fun! g:Ind2sp() | |
setlocal softtabstop=2 | |
setlocal shiftwidth=2 | |
setlocal expandtab | |
endfun | |
fun! g:Ind4sp() | |
setlocal softtabstop=4 |