Sublime Text 2ã§HTMLè¦ç´ ã®ã¯ã©ã¹åãIDã®é¸æãå°ãã ã楽ã«ããè¨å®
Sublime Text 2ã¯ãããã©ã«ãã®è¨å®ã§ã¯ã-ã(ãã¤ãã³)ãåèªã®åºåãæåã«è¨å®ããã¦ãã¾ãããªã®ã§ãHTMLè¦ç´ ã®ã¯ã©ã¹åãIDãªã©ã®ãã¤ãã³åºåãã®èå¥åãCtrl-d
ã®åèªé¸æã§é¸æãããã¨ãã¦ãä¸é¨åããé¸æã§ããªãã¦æ®å¿µãªæ°æã¡ã«ãªãã¾ãã
ãããããã®æ¯ãèãã¯ãã¡ããç°¡åã«ä¿®æ£ãããã¨ãã§ãã¾ããSublime Text 2ã®è¨å®é
ç®ã®ãã¡ã®ã²ã¨ã¤ãword_separators
ã®å
容ãå¤æ´ããã ãã§ãã
word_separators
ã¯ããã©ã«ãã§ã¯æ¬¡ã®ãããªè¨å®ã«ãªã£ã¦ãã¾ãã
"word_separators": "./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~?",
è¦ã¦ã®éããã¤ãã³ãåèªã®åºåãæåãªã¹ãã«å«ã¾ãã¦ãã¾ãããããåãé¤ãã¦ã¦ã¼ã¶ã¼è¨å®ãã¡ã¤ã«ã«ã³ããããã°OKã§ãã
åè
ãã®è¨å®ã¯ã¦ã¼ã¶ã¼è¨å®ãã¡ã¤ã«ã«ç´æ¥æ¸ãã¦ããã ãã§ãè¯ãã§ãããè¨èªåºæã®è¨å®ãã¡ã¤ã«ã«ç½®ãã¦ããã®ãããããã§ããåã¯ã¨ããããHTMLã¨CSSã¨JavaScriptç³»ã®è¨å®ãã¡ã¤ã«ã«ç½®ãã¦ãããã¨ã«ãã¾ããã(è¨èªåºæã®è¨å®ãã¡ã¤ã«ã¯ãè¨å®ãããè¨èªã®ãã¡ã¤ã«ãéãã¦ãã¡ãã¥ã¼ã®Preferences > Settings - More > Syntax Specific - User ã¨è¾¿ã£ã¦ããã°ç°¡åã«è¦ã¤ããã¾ã)
ä»ã«ãã
- JavaScript:ã$ããåèªã®åºåãæåãªã¹ãããå¤ãã¦ãã
- Ruby: ã!, ?ãã(ç¥)
- Lispç³»: ã-, !, ?, *, ãªã©ãããããã(ç¥)
ãªã©ãè¨å®ãã¦ããã¨ããããã§ãã:)
CoffeeScriptãå©ç¨ããPhantom.jsã®evaluateã§ãReferenceError: Can't find variable: __sliceãã¨ãªãåé¡
åå
Phantom.jsã®page.evaluate
ã«æ¸¡ãé¢æ°ã¯å¤å´ã®ã¹ã³ã¼ãã®å¤æ°ãå©ç¨ã§ããªãã®ã«ãCoffeeScriptã®ã³ã³ãã¤ã©ãå¤å´ã®ã¹ã³ã¼ãã®å¤æ°ãå©ç¨ããé¢æ°ãçæãã¦ãã¾ãããã
対ç
次ã®ãããªé¢æ°ãå©ç¨ãããã¨ã§page.evaluate
ã«æ¸¡ãé¢æ°ãå¤æ°ãèªèº«ã®ã¹ã³ã¼ãå
ã®ã¿ã§è§£æ±ºã§ããããã«ããã
toBeExecutableInBrowser = (func) -> str = func.toString().replace /\n/, '\n var __slice = [].slice;\n' eval "(#{str})"
ãããã¯æ¬¡ã®ããã«ãã¦page.evaluate
ã®åä½ãå¤æ´ãããã©ã¦ã¶å
ã«__slice
ã¨ããå¤æ°ãäºåã«å®ç¾©ããããã«ãã¦ããã
do () -> evaluate = page.evaluate page.evaluate = (func) -> evaluate.call @, `function() { window.__slice = [ ].slice; }` evaluate.call @, func
çµç·¯ã¿ãããªãã®(è足)
ä¾ãã°ãã¯ã¦ãªããã¯ãã¼ã¯ã®ãããã³ããªã®ã¿ã¤ãã«ä¸è¦§ãåå¾ãããã¨ããå ´åã次ã®ãããªã³ã¼ããæ¸ãã°ä¸æãããã¾ãã
page = require('webpage').create() page.open 'http://b.hatena.ne.jp/hotentry', (status) -> result = page.evaluate () -> links = document.getElementsByClassName 'entry-link' links = [ ].slice.call links JSON.stringify(links.map (link) -> link.innerText) titles = JSON.parse result console.log titles.join('\n') phantom.exit()
ãã©ã¦ã¶å ã§JavaScriptãå®è¡ããã¨ããã®
links = document.getElementsByClassName 'entry-link' links = [ ].slice.call links
ã¨ããé¨åã§document.getElementsByClassName
ã§åå¾ãããªã³ã¯ä¸è¦§(é
åã®ãããªãªãã¸ã§ã¯ã)ããã¡ãã¨ããé
åã«å¤æãã¦ãã¾ãã
ãã®é¨åãCoffeeScriptã®ææ³ãå©ç¨ãã¦æ¬¡ã®ããã«æ¸ãç´ãã¾ããã
[links...] = document.getElementsByClassName 'entry-link'
...ãããGood PracticeãBad Practiceãã©ããã¯ã©ããã¯ãã¦ããã¨ãã¦ãä¸å¿ããã§ãåãã¨æã£ããã§ãããå®è¡ãã¦ã¿ãã¨æ¬¡ã®ãããªã¨ã©ã¼ã«ãªã£ã¦ãã¾ãã¾ããã
ReferenceError: Can't find variable: __slice phantomjs://webpage.evaluate():3 phantomjs://webpage.evaluate():7 phantomjs://webpage.evaluate():7 TypeError: 'null' is not an object (evaluating 'titles.join') example.coffee:17
CoffeeScriptã®ã³ã³ãã¤ã©ãä½è¨ãªæ°ãå©ããã¦é
ååã®é¢æ°__slice
ãpage.evaluate
ã«æ¸¡ãé¢æ°ã®å¤å´ã§å®ç¾©ãã¦ãããã¨ãåå ã§ãããpage.evaluate
ã¯æ¸¡ãããé¢æ°ã®å¤å´ã«ããå¤æ°ãå©ç¨ã§ããªã(ã¨ãããPhantomå´ãããã©ã¦ã¶å´ã«é¢æ°ã渡ãéç¨ã§ã¹ã³ã¼ããã§ã¼ã³ãä¿æãã¦ãããã¨ãã§ããªã)ã®ã§ããã©ã¦ã¶å´ã§__slice
ã¨ããå¤æ°ã®è§£æ±ºã«å¤±æãã¦ããã¨ãããã¨ã§ãã
ããã§ããªãã¹ãé¢æ°ã®ã³ã¼ããå¤ããªããããªå½¢ã§ãã®åé¡ã解決ã§ããªããã¨ãããã試ãããã§ãããæçµçã«æ¬¡ã®ããã«ããã®ããã¿ã¼ããªã¨æãã¾ããã
toBeExecutableInBrowser = (func) -> str = func.toString().replace /\n/, '\n var __slice = [ ].slice;\n' eval "(#{str})" getTitles = () -> [links...] = document.getElementsByClassName 'entry-link' JSON.stringify(links.map (link) -> link.innerText) browserGetTitles = toBeExecutableInBrowser getTitles page = require('webpage').create() page.open 'http://b.hatena.ne.jp/hotentry', (status) -> result = page.evaluate browserGetTitles titles = JSON.parse result console.log titles.join('\n') phantom.exit()
toBeExecutableInBrowser
ã¨ããé¢æ°ãå©ç¨ãã¦ãpage.evaluate
ã«æ¸¡ãããé¢æ°ã®ä¸èº«ã«ç¡çãã__slice
ã®å®£è¨ã追å ãã¦ãã¾ãã¨ããæãã§ãã
ä¸å¿ããã§åãããã«ãªãã¾ãããã¾ãä»åã®å ´åã¯ã¹ã¤ã«[links...]
ã¨ããè¨æ³ã使ããã«[ ].slice.call
ã使ã£ããããããã[ ].map.call
ã使ãã°ããã£ãããã§ãããä»ã«ãè²ã
ã¨åããããªåé¡ãåºã¦ããã ããã¨ãããã¨ã§æ¸ãæ®ãã¦ããã¾ãããCoffeeScriptã®äºç´èªãªã¹ããè¦ãã«'__hasProp', '__extends', '__slice', '__bind'
'__indexOf'
ã®ãããã¯ã¾ãåããããªåé¡ãèµ·ããããã§ãã
ããä¸ã¤ã®ããæ¹ã¨ãã¦æ¬¡ã®ãããªã®ãè¯ãæãã§ãã
browserGetTitles = () -> [links...] = document.getElementsByClassName 'entry-link' JSON.stringify(links.map (link) -> link.innerText) page = require('webpage').create() do () -> evaluate = page.evaluate page.evaluate = (func) -> evaluate.call @, `function() { window.__slice = [ ].slice; }` evaluate.call @, func page.open 'http://b.hatena.ne.jp/hotentry', (status) -> result = page.evaluate browserGetTitles titles = JSON.parse result console.log titles.join('\n') phantom.exit()
page.evaluate
ã®åä½ãå¤æ´ãã¦ãå
ã«ã°ãã¼ãã«ã«__slice
ãå®ç¾©ããããã«ãã¦ãã¾ããCoffeeScriptã§ã¯__slice
ãäºç´èªã«ãªã£ã¦ããã®ã§JavaScriptåãè¾¼ã¿æ©è½ãå©ç¨ãã¦ãã¾ããpage.evaluateJavaScript
ã使ãã°ããå°ãç°¡æ½ã«ãªããã§ããããªããå©ç¨ã§ããªãã®ã§ããããå½¢ã«ãªãã¾ããã
ãã¨ã¯page.includeJs
ãpage.injectJs
ãªãããå©ç¨ãã¦ã解決ã§ãããã¨æãã¾ãã
ãã©ã¦ã¶ã§Base64ã¨ã³ã³ã¼ããããç»åããã³ã¼ããã¦é²è¦§ãã
(Chrome, Safari, Firefoxã§ç¢ºèª)
ãã©ã¦ã¶ã®ã¢ãã¬ã¹ãã¼ã«data:image/jpeg;base64,{{Base64æåå}}
ã¿ãããªæãã§å
¥åãã¦ç§»åããã¨è¡¨ç¤ºã§ãã¾ãã
ä¾
ã¨ããããGoogleã®faviconã§ãä¸ã®ãªã³ã¯ãã¯ãªãã¯ããããããã¹ããããªãã«ã¯ãªãã¯ãªããã§ã³ãã¼ãã¦ã¢ãã¬ã¹ãã¼ã«è²¼ãä»ãã¦ç§»åãã¦ã¿ã¦ãã ãããç»åã表示ãããã®ã確èªã§ããã¨æãã¾ãã
ãªã³ã¯å½¢å¼
ããã¹ãå½¢å¼
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4ge4SUNDX1BST0ZJTEUAAQEAAAeoYXBwbAIgAABtbnRyUkdCIFhZWiAH2QACABkACwAaAAthY3NwQVBQTAAAAABhcHBsAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWFwcGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtkZXNjAAABCAAAAG9kc2NtAAABeAAABWxjcHJ0AAAG5AAAADh3dHB0AAAHHAAAABRyWFlaAAAHMAAAABRnWFlaAAAHRAAAABRiWFlaAAAHWAAAABRyVFJDAAAHbAAAAA5jaGFkAAAHfAAAACxiVFJDAAAHbAAAAA5nVFJDAAAHbAAAAA5kZXNjAAAAAAAAABRHZW5lcmljIFJHQiBQcm9maWxlAAAAAAA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fogutN1K1Mtnf2csN1azSwyo7eFw1xLkvF2S4DP8AIMww2Y5ZmOGpYihXw9WFXl9rBTlQrxjJyoYmhJuliMPVUa1CtGdKrCM4yS78zyzHZPjsRl2Y4ephsXhqk6dSnUjKN+WTSqU3JL2lKolz0qsbwqQanCTi0z7Rv/26fDXxW+HHgr4f/tV/s9aD8dtR+G2hweGfA/xP0Px5rXwo+KFhoNqiR2una34g07RvFOneJ4reKNURdT0TypJPM1G5hn1m5vdUuvx2h4JZjwvxFnOfeF/H+O4Iw/EWNnmWdcNY3I8HxRw1Xx1VylUxGDwOIxmWYjLpTnJybw+M54q1CnOGDp0cLS+ynxxhs1y3A5fxVw/Qz2plmHjhcDmlDHV8qzWnh4WUKVfEU6WKpYqMYrlXtsO1e9SSlXlUqz8T1f8AaK0PQfCXjLwP8BPhZZfBvR/iNpI8O+PfEd34v1n4gfEjxN4TN3b303gt/Fd/a6FpGi+E9QvLS0uNa0/w34S0e+182tta63qmoabEtjX2WE8Psbjs1yfO+OuJ63F+L4exX9oZFl9LKcHkPDuXZr7KdGGcrK6FXHYrG5rQo1atPB4jMc1xdDA+1qVcHhaGJm654lXiGjh8LjcFkWWRyejmNL6vj8RPF1swzLE4TnjUlgni5ww9GjhKlSEJ1qeGwdGpiOSMK9WrSSgeNfDH4Y+OPjF448PfDz4eeHtS8S+KPEupWmm2FhptpPdGH7VPHDJf37wxutjpVgjm61LUroxWdhZxTXV1NFDE7j7DiXiXJeEclzDP8/zDDZdlmXYariK9fE1YU+f2cJTVChGclKvia8kqWHw9JSrV604UqUJTkk/IyzLMdnGOw+XZdh6mJxeJqRp06dOMpW5pJOpUaT9nSpp89WrO0KcFKc5KKbP/2Q==
MIMEã¿ã¤ãã®ã¨ãããå¤ããã°PNGãGIFã¨ãã£ãä»ã®å½¢å¼ã®ç»åããããã¹ããã¡ã¤ã«ãªããã表示ã§ãããã§ãããä¸ã¯ãBase64ãã¹ããã¨æ¸ãããããã¹ããã¡ã¤ã«ãBase64ã¨ã³ã³ã¼ãããä¾ã§ã(ããæååããã¦ããã°ãã©ã¦ã¶ã®ã¨ã³ã³ã¼ãæå®ãUTF-8ã«å¤æ´ããã°æ£ãã表示ãããã¨æãã¾ã)ã
data:text/plain;base64,QmFzZTY044OG44K544OICg==
Googleç»åæ¤ç´¢çµæã®imgã®srcå±æ§ã«ä½¿ããã¦ããã®ãè¦ã¦ç¥ãã¾ãã:)
追è¨
ããããã®ã¯Data URI schemeã¨ãããããã
GitHubã®ãã¼ãã¼ãã·ã§ã¼ãã«ããä¸è¦§è¡¨ç¤º
GitHub�
ã¨ã¿ã¤ãããã¨ä¸ã®ããã«ãã¼ãã¼ãã·ã§ã¼ãã«ããã®ä¸è¦§ãè¦ãããã
ãã¿å
GitHub Pageså©ç¨ã¡ã¢
Gitåããªããããããããã¨ã¯ããããã£ã¦ãã¾ã:(
ãããããªãµã¤ããåèã«ããã¦ããããªãããªãã¨ã解決ã
GitHubã«masterãã©ã³ãã¯ç»é²ããã«gh-pagesãã©ã³ãã ããç»é²ãã¦ãã®ã¾ã¾gh-pagesã§éçºãã¦ãããã¨ãããããªãã¨ããããã£ãã
åèãµã¤ã
- Githubã§gh-pagesãä½æãã | jekylog
- å®è·µGitHub Pageséç¨ã®ã¦ã¼ã¹ã±ã¼ã¹ã¨ã¯ã¼ã¯ããã¼ã®è©³ç´° | ãã£ããã¨â¦
- GitHub Pagesãã¹ãã£ã³ã°ãµã¼ãã¹ï¼ã»ã¼ï¼å®å ¨æ´»ç¨ã¬ã¤ã | ãã£ããã¨â¦
- github:help
ã³ã¼ã
masterãgh-pagesã«æ¹åããç
git init echo "hello world" >> index.html git add . git commit -m "first commit" git branch -m gh-pages git remote add origin [email protected]:username/repositoryname.git git push -u origin gh-pages
ãã¼ã«ã«ã®masterããªã¢ã¼ãã®gh-pagesã«pushããç
git init echo "hello world" >> index.html git add . git commit -m "first commit" git remote add origin [email protected]:username/repositoryname.git git push -u origin master:gh-pages
GitHubã§ã®æ¤ç´¢
ã¡ãã£ã¨åã®è©±é¡ã ãã©ãGitHubã®æ¤ç´¢æ©è½ã®æ¹è¯ããã£ããããªã®ã§ãªã³ã¯ã®ã¡ã¢ããã¨ãæ¤ç´¢ã®ããããã¼ã¸ã«ãããããªãã£ã«ã¿ã¼ãè¼ã£ã¦ããã®ã§ãã¡ããã¡ã¢ã
追è¨(2013/01/24)
GitHubã«ã³ã¼ãã®å ¨ææ¤ç´¢æ©è½ã追å ããã¦ããããã¼ã¸ã®ãã¶ã¤ã³ãä¸æ°ããã¦ãã
JavaScripté¢é£ãããã
åå¿é²çã«ã
Backbone.js in Practice: Part I â Preventing Memory Leaks
Backbone.jsã«ãããã¡ã¢ãªãªã¼ã¯å¯¾çã®è§£èª¬ãBackbone.jsã«ãããã¡ã¢ãªãªã¼ã¯ã¯ã¤ãã³ããã¤ã³ãã£ã³ã°ã¨ãã¹ããããã¥ã¼ã鬼éãªãã ãã©ããããã«å¯¾ããã¡ã¢ãªãªã¼ã¯å¯¾çã®ãã¿ã¼ã³ãåããããã解説ããã¦ããã
ãã¾ã¾ã§ã¡ã¢ãªãªã¼ã¯ã®ãã¨ãæ°ã«ãããã¨ãªãã£ãã®ã§ããã«ãªã£ããã¾ãã¡ã¢ãªãªã¼ã¯ãæ°ã«ããã»ã©ã®å¤§ããªBackbone.jsã¢ããªä½ã£ã¦ãªããã©:)
Marionette.js â A scalable and composite application architecture for Backbone.js
Backbone.jsã®æ¡å¼µçãªãã®ï¼GitHubã§ã®Staræ°ã1600ãè¶ ãã¦ãã¦ããªã人æ°ã£ã½ãã
GitHubä¸ã®READMEãã¡ããã£ã¨èªãã ã ãã ãã詳ããã¯åãããªããã©ãã¡ã¢ãªç®¡çã®æ©è½ãç¨æãã¦ãããããã¥ã¼ãã¤ãã³ãã®ç®¡çã楽ã«ã§ããããããããï¼æ©ã詳ãã調ã¹ããã
novus / nvd3
ãã£ã¼ãã©ã¤ãã©ãªãã°ã©ãæç»ç³»ã®ã©ã¤ãã©ãªã¨ããã°å°ãåã«Morris.jsã話é¡ã«ãªã£ã¦ãããã©ããã®NVD3ã¯D3.jsãå©ç¨ãããã®ã
ã¾ã ã¾ã éçºéä¸ã»çºå±éä¸ã£ã¦æãã ãã©ãªããªãè¯ããããªã«ããD3.jsãå©ç¨ãã¦ãã£ã¦ã¨ããã(ã»âã»)イイ!!
æè¿ã¡ãã£ã¨ããã家é¨åã¿ãããªãã¨ããã£ãããããå ¬å¼ãµã¤ãã«è¬ç½ªæçãªãã®ãè²¼ããã¦ããã©ãã¾ãçµæçã«ããããããã£ã¨ãªã¼ãã³ã½ã¼ã¹ããã¸ã§ã¯ãã¨ãã¦ãã£ã¦ãããã¨ã«ãªã£ããããããä¸å®å¿ã