A new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team
ããèªãã§ããr7kamuraåã«JSã®MVCã©ãããã®çãªè©±ãããã¦ãã®ãæãåºããã®ã§ãèªåãBackboneã使ãæã®ãã¿ã¼ã³ãr7kamuraåã®è¨äºããã¼ã¹ã«æ¸ããªããã¦ã¿ãã > ãµãã¯ã©ä¸¡æ¹ã§åã JavaScript ã®å¤§è¦æ¨¡éçºãè¡ãããã« â Gist https://gist.github.com/1362110 > client-side javascript - ââ¹â¡â¹â http://r7kamura.hatenablog.com/entry/2012/10/18/023629 以ä¸ã®æ§ãªã³ã¼ããæ¸ãããããªãåé·ã ããè¤éãªã¢ããªã ã¨ãããããã®åé·æ§ã¯å¿ è¦ã«ãªãã (ãªãæ¦å¿µãä¼ããããã®è§£èª¬ç¨ã³ã¼ããªã®ã§ãã®ã¾ã¾ããåããªã) Backbone.Model # åå空éã®åæå App = {} App.View = {} App.Model = {}
CoffeeScript 㯠Ruby / Python ã«ä¼¼ãè¨æ³ã§ (çµæã¨ãã¦) JavaScript ãæ¸ããã¨ãã§ããããã°ã©ãã³ã°è¨èªã§ãã CoffeeScript ãã³ã³ãã¤ã«ããã¨Â JavaScript ã«ãªãã®ã§ã JavaScript ããã°ã©ãã³ã°ã¯ CoffeeScript ã§ç½®ãæãããã¨ãã§ãã¾ãã Titanium Mobile 㯠JavaScript ã使ã£ã¦ iOS ã Android ãªã©ãã¢ãã¤ã«åãã®ã¢ããªã±ã¼ã·ã§ã³éçºãè¡ãããã®ãã¼ã«ã§ããããããã CoffeeScript ã§ç½®ãæãããã¨ãã§ãã¾ãã Titanium Mobile ã§Â CoffeeScript ã使ããã¨ã§ãã©ããªã¡ãªãããããã®ããããã¤ã¾ãã§èª¬æãã¾ããããã¦ããªã¹ã¹ã¡ãããã©ããããã§ãã£ã¨æ¸ãã¾ãã æ¬å¼§ãæ¸ã æ¬å½ã«æ¬å¼§ãæ¸ãã¾ãã Titanium Mobi
A社coffee-scriptã¨ã´ã¡ã³ã¸ã§ãªã¹ãã®mizchiã§ããä»æ¥ã¯æ¨ä»ã®å¤§è¦æ¨¡JSã®éè¦ã®é«ã¾ãã«å¿ããã¹ãããåãç¥ã£ã¦ãè³æãã¾ã¨ããã¨ã®ãéããä¸ã£ãã®ã§ã社å wikié¢åã ãããã«è¼ãã¦ã¾ããã åæ 大è¦æ¨¡JSãã¢ã¸ã¥ã¼ã«åããçºã«coffee-scriptã®ã·ã³ã¿ãã¯ã¹ã·ã¥ã¬ã¼ã§OOPã®ãã©ãã¤ã ãæã¡è¾¼ã coffee-scriptã®ç ©éãªã³ã³ãã¤ã«ä½æ¥ãé¿ããããã«ãRails/Nodeã§ã¯ã¢ã»ãããã¤ãã©ã¤ã³ã使ã£ã¦åçã«ã³ã³ãã¤ã«ã¨å§ç¸®ãè¡ã JSããã¸ã§ã¯ããé¨åçã«nodeåãã¦TDDã§ãµã¤ã¯ã«ãåã coffee-scriptã«é¢ãã¦ã¯ãåºæ¬çã«ã¯æ¬å®¶ãã¥ã¼ããªã¢ã«ã¨ The Little Book on CoffeeScript ãèªãã°ãã coffee-script ãã¥ã¼ããªã¢ã« æ¬å®¶ãã¥ã¼ããªã¢ã« CoffeeScript little book
ã¤ãã³ãé§ååã®ããã°ã©ã ããããã«ä½ã JavaScriptã®ããã°ã©ã ã¯ãã¤ãã³ãé§ååã§éåæãªæ§é ãåºæ¬ã¨ãªãã¾ããä»ã®ããã°ã©ãã³ã°è¨èªã§ä¸è¬çãªãåæåãã®é¢æ°ã§ã¯ãä¾ãã°ãããã¯ã¼ã¯çµç±ã§ãã¼ã¿ãèªã¿è¾¼ãå ´åããã¼ã¿ãèªã¿è¾¼ãé¢æ°ãå®è¡ããã¨ãã®èªã¿è¾¼ã¿ãå®äºããã¾ã§ããã°ã©ã ã®å®è¡ã¯æ¢ã¾ã£ãã¾ã¾ã«ãªãã¾ãã ããã«å¯¾ãã¦ããéåæåãã®é¢æ°ã使ãã¨ãã¼ã¿ã®èªã¿è¾¼ã¿ãå®äºããã¾ã§ä»ã®å¦çãå®è¡ã§ããèªã¿è¾¼ã¿ãå®äºããå¾ã§ç¹å®ã®é¢æ°ãå¼ã³åºãã¦ããããã¨ãã§ãã¾ãã身è¿ãªä¾ã«ä¾ããã¨ãã¡ã¼ã«ãéä¿¡ãã¦ç¸æããã®è¿ä¿¡ãæ¥ãã¾ã§ä½ãããã«å¾ ã¤ã®ãåæåé¢æ°ã ã¨ããã°ãéåæåé¢æ°ã¯è¿ä¿¡ãå¾ ã¤éã«ä»ã®ä»äºãããªããã¨ãã§ãã¾ãã Webã¢ããªã±ã¼ã·ã§ã³ã¯ãããã¯ã¼ã¯éä¿¡é¨åã«æãæéããããå ´åãå¤ãããããã®å¾ ã¡æéã«ä»ã®å¦çãããªãã°ããã å¾ ã£ã¦ãããããé¥ãã«å¹çããå¤ãã®å¦ç
ã¾ãã¾ãååã«å¼ãç¶ã CoffeeScript ã«ã¤ãã¦ã®ã¨ã³ããªã¼ã§ã. ä»åã¯ä»¥åæ¸ãããJavaScript å ¥é åºç¤ç·¨ãã§ä½ã£ããµã³ãã« 10 åã CoffeeScript ã§ä½ãç´ãã¦ã¿ã¾ãã. CoffeeScript çã JavaScript çã, å ¨ã¦ jsdo.it ã«ã¢ãããã¦ããã®ã§ ã³ã¼ããè¦æ¯ã¹ã¦ã¿ãã¨é¢ç½ãããããã¾ãã. { } } }{ { { }{ } } _____ __ __ }{ }{ { ) / ____| / _|/ _| .- { { } { }} -. | | ___ | |_| |_ ___ ___ ( ( } { } { } } ) | | / _ \| _| _/ _ \/ _ \ |`-..________ ..-'| | |___| (_) | | | || __/ __/ | | \_____\___/|_| |_| \
programming notes. mainly about JavaScript / jQuery. [@Takazudo] [takazudo@gmail.com] Hint: alt + / æè¿MVCãã©ãã®ã¨ã調ã¹ãããã¦ãããã§ãåSpine.jsã§ä½ã£ããã¤ããBackbone.jsã«ãã¦æ¸ãã¦ã¿ãã Backbone.jsä½ã£ããã¤# Template manager # //hamalog.tumblr.com/post/13593032409/jquery-tmpldeck deck = $.TmplDeck 'templates.html' # ============================================ # API wrapper # ============================================ api =
RegEx Cafe - JavaScript Regular Expression Tester http://kkosuge.github.com/regex-cafe/ CoffeeScriptã§æ¸ããã®ã§Cafeã§ãã ãµã¯ãã¨æ£è¦è¡¨ç¾ã®ç¢ºèªããããã¨ã Rubular ã便å©ã§ä½¿ãäºãå¤ãã£ããã ãã©ãè½ã¡ã¦ãäºãå¤ãã£ãããµã¤ãèªä½ãè½ã¡ã¦ãªãã¦ãããã¹ãçµæã®è¡¨ç¤ºããã©ãã¼ã«é ãäºããã£ãããããå ¥åãããã³Ajaxã§çµæåãã«è¡ã£ã¦ãããé ããªãã®ã¯ä»æ¹ãªãæ°ãããã ãã©ãç°¡åãªç¢ºèªããããªãJavaScriptã§ãããããã¨æã£ãã®ã§åéçºãã¾ãã次第ã§ããGithubãã¼ã¸ã«ãã¹ãã£ã³ã°ãã¦ããã£ã¦ãã®ã§è½ã¡ãäºã»ã¨ãã©ãªãã ããããéä¿¡ããªãã®ã§éãã§ãã æ£è¦è¡¨ç¾ãã¹ããã¼ã«ã®æ¢åºæãã°ããã©ããã®ä¸ã§ãRegEx Cafeã¯ã ãã¶ä½¿ãæãã¦è¯ãã¨æãã Cof
ãã以éãCoffeeScriptã§JSãæ¸ãç¶ãã¦ãã¦ããã£ã±CoffeeScriptãããªã¼ã¨çµæ§æã£ã¦ããèªåã«ã¨ã£ã¦ã®CoffeeScriptãããã¨æãä¸çªã®çç±ã¯ãããªãã¸ã§ã¯ãæåçãªã³ã¼ãããã¹ãã¬ã¹ç¡ãæ¸ãããããã£ã¦ããç¹ã ã¨æãã¦ããä¾ãã°ã以ä¸ã®ãããªåä½ãããUIãããã
CoffeeScript ã¨ã¯ãJavaScriptã«ã³ã³ãã¤ã«ã§ããç°¡æè¨èªã JavaScriptã®è¯ãã¨ããã¯ãã®ã¾ã¾ã«ãRubyãPythonã®ããã«ãã£ããã¨æ¸ããã æ¢åã®JavaScriptã©ã¤ãã©ãªãã·ã¼ã ã¬ã¹ã«ä½¿ããã JavaScript Lintã«ãéãèªã¿ãããJavaScriptãåºåãããã©ããªJavaScriptå®è£ ã§ãåä½ããã ï¼æ¬å®¶ç´¹ä»ããï¼ ãªãã ãè¯ãããã ï¼ CoffeeScript ã¤ã³ã¹ãã¼ã« Coffee ã³ãã³ã CoffeeScript è¨èªãªãã¡ã¬ã³ã¹ Cake ãã¼ã« defunkt/coffee-mode for Emacs ãã®ä»ã¨ãã£ã¿ç¨ãã©ã°ã¤ã³ãªã©
CoffeeScript/Canvasã§ã²ã¼ã ä½ã£ã¦ã¦ãçµæ§å·¨å¤§ãªããã¸ã§ã¯ãã«ãªã£ã¦ãã¾ã£ãã®ã§è²ã 工夫ãã¦ããã åä½ã®ã¨ã EmacsãVim使ã£ã¦ããªã shadow.el/shadow.vim ã使ã èªåã¯emacsãªã®ã§shadow.elãå ¥ããã mooz/shadow.el - GitHub (require 'shadow) (add-hook 'find-file-hooks 'shadow-on-find-file) (add-hook 'shadow-find-unshadow-hook (lambda () (auto-revert-mode 1))) hoge.js.shd(CoffeeScriptã¨ãã¦è¨è¿°) ## coffee -csb f = (x) -> x + 1 f2 = (x) -> x + 1 print f 10 # Local Variab
*追è¨* æ¬å®¶ã«ãã¼ã¸ãããã®ã§ãããã©ã«ãã§ãã®æ©è½ä½¿ãã¾ã https://github.com/defunkt/coffee-mode ãåç §ãã¦ãã ãã CoffeeScriptã¯ç´ æ´ãããè¨èªãªãã ãã©ããããä¸ã®ãµã³ãã«ã¯åºæ¬çã«JSã§è»¢ãã£ã¦ãã®ã§ãã³ããããéã¯æä½æ¥ã§ä¿®æ£ããå¿ è¦ãããã¾ãã ã§ãjs2coffeeã£ã¦ããjavascript -> CoffeeScript ã£ã¦å¤æãè¡ãããã°ã©ã ããããã ãã©ããã使ã£ã¦Emacsã®coffee-modeã§javascriptãcoffeeã«ç½®æã§ããããã«ããã 使ãæ¹ ãããªã³ã¼ããæ¾ã£ã¦ããã¨ã㦠hoge = function(){ console.log("hello"); };ãªã¼ã¸ã§ã³é¸æã㦠M-x coffee-js2coffee-replace-region ããã¨ç½®æããã hoge = -> c
CoffeeScriptã«ã¤ã㦠ãããã¨ãããã°ããCoffeeScriptã¨Titaniumã®çµã¿åããã§éçºãã¦ããããã ãã©ãCoffeeScriptã«é¢ãã¦è¨ãã°ç¹ã«å¤§ããªãããã©ããããªãå¿«é©ã«ä½¿ãã¦ããã å¼·ãã¦è¨ãã°ãã®éã®@ã ãã©ãããã¯ã©ã£ã¡ãã¨ããã¨JavaScriptã®ãããã©ããã ã£ãããã§ã ææ³ãè¦ããã³ã¹ããã¼ãã¨ã¯è¨ããªãããRubyã®ããã¯ã°ã©ã³ããæã£ã¦ããããããããªã«è¦å´ã¯ããªãã£ãã æ¸ãæ¹ãè¦ãã¦ãã¾ãã°JavaScriptãããããããæ¸ãã¦ãããªãçç£æ§ã«å¯ä¸ãã¦ããã¦ããã®ã§ã¯ãªããã¨æãã å人çã«ã¯å¾ç½®ã®ifã¨forãç¹ã«ãæ°ã«å ¥ãã Titaniumã¨ã®çµã¿åããã«ã¤ã㦠Titaniumã¨ã®çµã¿åãããã¾ã£ããåé¡ãªãã éã«CoffeeScriptãªãã§ã®éçºãä»ã¨ãªã£ã¦ã¯èããããªããããã Resources以ä¸ã§ä»¥ä¸ã®ã³ã¼
ããæ¹ å®ç¾©ã®éã«@ãé ã«ä»ããã class Something someProp: "hoge" someMethod: -> ... @someClassProp: "HOGEHOGE" @someClassMethod: -> ... ã©ããã£ã¦ãããã ããã¨æ¢ãããããã¥ã¡ã³ãã«è¿½è¨ã£ã½ãã¡ããã£ã¨æ¸ãã¦ãã£ãã object itself (the constructor function), you can assign static properties by using @property: value, and call functions defined in parent classes: @attr âtitleâ, type: âtextâ ã¾ãããã¥ã¡ã³ãèªä½ãã¡ãã£ã¨è§£èª¬ã®ã¤ãããã¼ãã·ã¼ãã¿ãããªå ·åãªã®ã§ããããããªãã¨ãã¡ããã£ã¨æ¸ãã¦ããã Java
ã¡ã£ã¡ããCoffeeScriptã®æ¬
Node.jsã§ã®Hello worldãæ¸ã¾ãã¦ãexpressã³ãã³ãã§ã¢ããªã®éå½¢ãèªåçæã§ããããã«ãªã£ãã®ã§ãèªåãNode.jsã«èå³ãæã£ãå½åã®ç®çã§ãã以ä¸ã«ã¤ãã¦å®è¡ãã¦ã¿ãã æ®æ®µèªåãRubyã§ä½¿ã£ã¦ããSinatra+Slim+Sassã¨ä¼¼ããããªéçºç°å¢ããNode.jsã§ãExpress(CoffeeScript)+Jade+Sassã使ãã°å®ç¾ã§ããããï¼ å人çã«ã¯ãä¸è¨ã®æ¶æ¸¬ããªãã£ããNode.jsããã£ã¦ã¿ããã¨æããªãã£ãã¨è¨ã£ã¦ãéè¨ã§ã¯ãªãã®ã§ãã§ããã ãæ©ã段éã§ãã®çµã¿åããããã£ã¦ã¿ããã¦ãã¾ãã¯CoffeeScriptã触ã£ã¦ã¿ãã Node.jsã¢ããªã®éå½¢ãèªåçæ ã¾ãã¯Node.jsã¢ããªã®éå½¢ãèªåçæããã-cãªãã·ã§ã³ã§CSSã«ã¯Sassã使ããã¨ãæå®ãããHTMLã¯ããã©ã«ãã§Jadeãé¸ã°ããã®ã§æå®ã¯ãªãã $
nodejs, coffeescript æè¡ãã¢ã¬ãã¦éãã§ãã竹馬ã§ãã æ¦è¦ ã¿ãªãããNodeJSããåç¥ã§ããï¼ ãµã¼ãã¼ãµã¤ããJavascriptã§ããã¨ããã¢ã¬ã§ãã CoffeeScriptã¯ã©ãã§ãããï¼ ç°¡æãªææ³ã§ããã¹ããã©ã¯ãã£ã¹ãªJavascriptã®ã³ã¼ããçæãã¦ããã¾ã å®éã«å®è¡ããã¢ããªã±ã¼ã·ã§ã³ã®ãæå°ç°å¢ã¯ãã®ããã«ãªãã¾ã ### app.coffee ### express = require 'express' app = express.createServer() app.get '/', (req,res) -> res.send 'Hello World' app.listen 3000 ãããå®è¡ã㦠http://locahost:3000/ ã«ã¢ã¯ã»ã¹ããã¨ããã©ã¦ã¶ä¸ã§ã¯Hello,World! ã¨è¡¨ç¤ºããã¾ã ã£ã¦ããã®
CoffeeScriptã®å°å ¥æ¹æ³ããç°¡åãªä½¿ãæ¹ã«ã¤ãã¦ã¯ãç´ æ´ãããè¨äºãããããããã¾ãã®ã§ã ããã§ã¯ãç§ãå人çã«å¥½ããªã¨ãããæ¸ãã¨ãããè¯ãããããªããã¨ãããã¦ãã ããã ã¡ãªã¿ã«CoffeeScriptã¨ããã®ã¯ãRubyãPythonã®ãããªææ³ã§javascriptãè¨è¿°ã§ããè¨èªã§ Rails3.1ã§ãæ¡ç¨ããã¦ããããã¾ãã ã§ã¯ããã£ãã好ããªã¨ãããæãã¦ããã¾ãã (以ä¸ã«æ²è¼ãã¦ããã³ã¼ãã®ã³ã³ãã¤ã«ã¯ coffee -c ã§è¡ã£ã¦ãã¾ãã) â ã»ãã³ãã³ããããªã CoffeeScriptã¯ã»ãã³ãã³ãä»ããç¶æ ã§javascriptãçæãã¦ããã¾ãã èªåã¯ã»ãã³ãã³ãå¿ãããã¨ããã£ããããã®ã§ããã¾ãæèããã«æ¸ãããã«ãªãã®ã§å¥½ãã§ãã â ã°ãã¼ãã«æ±æããã«ãã CoffeeScriptã§ã¯ã°ãã¼ãã«æ±æãèµ·ãã«ããããã«ã§ãã¦ãã¦å¥½ãã§
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}