CtrlPã§cdnjs.comã®URLãå ¥åããctrlp-cdnjsãä½ã£ã
試ãã«ã¡ããã£ã¨HTMLã¨JavaScriptæ¸ãã¦ç¢ºèªã¨ããããã¨ãã«ãjQueryã¨ãã®ã©ã¤ãã©ãªããã¦ã³ãã¼ããã¦ç¨æããã®ã¯é¢åãªã®ã§ã©ã£ãã®CDNããæåãããã¨ãå¤ããã ãã©ããã®URLãæ¯åã°ã°ã£ã¦ã³ããããã®ãããå æ¸ã ããã®ã§Vimã®CtrlPã§é¸æãã¦å
¥åã§ããããã«ãã¦ã¿ãã
extensionã®ä½ãæ¹ãããããããªãã£ãã®ã§mattnããã®extensionããã¯ãåèã«ããã
https://github.com/pasela/ctrlp-cdnjs
Retinaãªãããªã®ãLICEcapã§ãã£ããã£ããã¨æ»²ãã ã¿ããã«ãªãããã£ã¨ç¶ºéºã«æ®ãæ¹æ³ãªãããªï¼
使ãæ¹
ãã®extensionã¯ãã¡ã¤ã«ãéãããããããã§ã¯ãªãã®ã§ãã¡ãã£ã¨è¡åæªãã¨æãã¤ã¤ã以ä¸ã®ããã«å²ãå½ã¦ãå¤ãã¦ããã
ãã¼ | åä½ |
---|---|
Enter | URLãæ¿å ¥ãã |
Ctrl+T | scriptã¿ã°ï¼cssã®å ´åã¯linkã¿ã°ï¼ãæ¿å ¥ãã |
Ctrl+S | URLã¹ãã¼ã ãhttpâhttpsâscheme-lessã¨åãæ¿ãã |
Ctrl+V | cdnjs.comä¸ã®ã©ã¤ãã©ãªãã¼ã¸ããã©ã¦ã¶ã§éã(è¦open-browser.vim) |
æ¿å
¥ãããURLã®ã¹ãã¼ã ã¯ããã©ã«ãã§ã¯http:ã«ãªã£ã¦ã¦ãCtrl+Sãæ¼ããã¨ã«https:ãscheme-less(//example.comã¿ãããªãã¤)ã¨ãã¼ãã¼ãããã
è¦å´ããç¹
jquery-ãªãã¡ããããã£ãå¤ãã¦ããã ã®jqueryãé¸æã§ããªãã
CtrlPã¯è©²å½ããåè£ã®ãã¡ä¸é¨ãããªã¹ãã«è¡¨ç¤ºãããªãã®ã§ã
jquery-gamequery (v0.7.0) jquery-color (v2.1.2) jquery-easing (v1.3) jquery-footable (v0.1.0) jquery-browser (v0.0.6)
ã¿ããã«ãªã£ã¡ãã£ã¦jqueryãç»é¢å
ã«åºã¦ããªãã
ãã¼ã¸ã§ã³ã¾ã§æå®ããã°ããããããã©ããã¼ã¸ã§ã³ã¨ãç¥ãããã
æ£è¦è¡¨ç¾ã¢ã¼ãã«ããã°ãããå¯è½ã ãã©é¢åããããã¦ã¼ã¶ã«å§ããããã®ãæ°ã«å
¥ããªãã
g:ctrlp_match_funcã§ãããã³ã°å¦çããããã¨ããã®ãèãããã©ããããã¦ã¼ã¶å´ã§ã°ãã¼ãã«ã«è¨å®ããæ©è½ãªã®ã§ãã¡ã
ã§ããã¾ã解決æ¹æ³ãæµ®ãã°ãªãã£ããã ãã©ãã¨ãããããªã¹ããã½ã¼ããã¦ãããã¨ã§èª¤éåãã¦ã¿ãã
åè£ã¯ãªã¹ãé ã«åºã¦ããã¿ãããªã®ã§ãã½ã¼ããã¦jqueryãå
é ã«æ¥ãããã«ãã¦ããã°jqueryã¨å
¥åããæç¹ã§ã¨ããããjqueryãè¿ãä½ç½®ã«æ¥ãã
extensionæ¯ã«ãããã³ã°é¢æ°ãå®ç¾©ã§ããããåæ¹ä¸è´ã§ãããã³ã°ã§ããã°ããã£ãããã
ToDo
ã©ã¤ãã©ãªã®ãã¼ã¸ã§ã³ãé¸ã¹ãããã«ããã
cdnjs.comã«ã¯éå»ã®ãã¼ã¸ã§ã³ãªã©ãããã®ã§ãç¹å®ã®ãã¼ã¸ã§ã³ãæå®ã§ããããã«ãªãã¨ãããããããªãã¨æã£ãã®ã ãããã¾ãã¤ã³ã¿ã¼ãã§ã¤ã¹ãæãã¤ããªãã£ãã
å
¨ãã¼ã¸ã§ã³ãåè£ã«ä¸¦ã¹ãã¨é¬±é¶ããããåè¿°ã®è¡¨ç¤ºæ°åé¡ãããã®ã§çµããããªãã
ãã¼ã¸ã§ã³çµãè¾¼ã¿ç¨ã®CtrlPå¼ã³åºãã«ç¹ãã¨ããã®ãèãããã©ãã§ããã®ãããããªããå¾®å¦ãªæããããã®ã§è©¦ãã¦ãªãã
è¤æ°ãã¡ã¤ã«åé²ããã¦ãå ´åã«å¯¾å¿ããã
ã©ã¤ãã©ãªã«ãã£ã¦ã¯è¤æ°ãã¡ã¤ã«ã ã£ãã.jsã¨.cssãã»ããã«ãªã£ã¦ããã®ãªã©ãããã®ã§ããã®ã¸ããã¾ã¨ãã¦æ¿å
¥ã§ãããããã¨ãããªã¨æã£ãã
ãããminimizeãã¦ãããã¤ã¨ããã§ãªããã¤ã¨ãã.mapã¨ããcsså
ã§ä½¿ã£ã¦ãç»åãã¡ã¤ã«ã ã¨ããæ··ãã£ã¦ãããã¦ãã©ããå¿
è¦ãªãã¡ã¤ã«ãå¤å¥ã§ããªãã£ãã®ã§è«¦ããã
ããã¦ä»£ããã«Ctrl+Vã§ã©ã¤ãã©ãªã®è©³ç´°ãã¼ã¸ãéããããã«ãããããã§å¿
è¦ãªãã¤ã¯ã³ãã¼ãã¦ããããã¨ããéãã
è¤æ°é¸æãã¦ä¸æ¬æ¿å ¥ããã
ä¾ãã°jqueryã¨jquery-uiãé¸æãã¦ã¾ã¨ãã¦æ¿å
¥ã¨ããããã£ãã
opmulã¨ãããªãã·ã§ã³ãæå®ããã¨CtrlPæ¨æºã®ãã¡ã¤ã«é¸æã¿ããã«Ctrl-Zã§è¤æ°é¸æã§ããã®ã¯ããã£ããã ãã©ããã³ããªã³ã°æ¹æ³ãããããªãã£ãã
ã©ã¤ãã©ãªæ å ±ããã£ãã·ã¥ããã
æ¯åcdnjs.comã«ã伺ãããã®ããããªã®ã§ãã£ãã·ã¥ãããã£ããã ãã©ãCtrlPã®ãã£ãã·ã¥ã®ä»çµã¿ãããããããªãã£ãããF5æ¼ããæã®ãã³ããªã³ã°ãããããªãã£ããç¬èªã«å®è£ ãããããªãï¼
èªåãããããã£ã¦ãªãã ããããããªããã©ãã©ããçµã¿è¾¼ã¿æ©è½ã§ã¯ä½¿ãããã©extensionã§ã¯ä½¿ããªãæ©è½ã¨ãããã£ã½ãã
Macã§ä½¿ã£ã¦ãã¢ããªï¼2014å¹´çï¼
Macãåãã¦è²·ã£ãæã«環境構築の記事ãæ¸ããã®ã ãã©ããããã4å¹´çµã£ã¦å
容ãå¤ãã£ã¦ããã®ã§æ¹ãã¦ä»ä½¿ã£ã¦ããã¢ããªãåæãã¦ã¿ãã
ãã¡ãããåèã¨ãã¦ï¼ä½¿ã£ã¦ãªããã©ï¼åè£ã«ããã£ã競åã¢ããªãæãã¦ããã¾ãã
ãªããUNIXç³»ã®ã³ãã³ãã©ã¤ã³ãã¼ã«ã¨ãã¯ããã ãã§å¥ã®è¨äºä¸æ¬ã«ãªããããªã®ã§å²æã
ç¹ã«ããããã ã¨ãããããããã§ã¯ãªããã©ãã©ããªã¢ããªããããã ããã¨æ¢ãã¦ã人ã®åèã«ãªãã°ã¨ã
èªåããããã£ã¦ä»äººã®ããããã¢ããªè¨äºã¨ããåèã«ãã¦ããã¾ã§è¾¿ãçããããã
App Storeã§å ¬éããã¦ããã¢ããªã«ã¤ãã¦ã¯App Storeã®ãªã³ã¯ãè¼ãã¦ããã¾ããã
ãªã©ã®ãã©ãããã¨ãã©ãããã®ã§ãåèªã§å
¬å¼ãµã¤ããªã©ã確èªãã¦ãã ããã
ç°å¢ç³»
KeyRemap4MacBook
Macã®ãã¼ããããè²ã
ã¨è¨å®ã§ãããã¼ã«ãå¿
é ã
ããã¯ã¹ã©ãã·ã¥åé¡ã¨ãcapsã殺ãã¨ãUSãã¼ãã¼ãã§cmdã«ããªãå²ãå½ã¦ãã¨ãã
BetterTouchTool
ãã©ãã¯ããããè²ã
ã¨è¨å®ã§ãããã¼ã«ãå¿
é ã
æ¨æºè¨å®ä»¥ä¸ã«ç´°ããã¸ã§ã¹ãã£ãè¨å®ã§ããããã¦ã¹ããã¼ãã¼ãã®è¨å®ãå¯è½ã
Google 日本語入力
ãã¨ããççºããï¼
HyperSwitch
cmd+tabã®ã¦ã£ã³ãã¦åãæ¿ããã¦ã£ã³ãã¦åä½ã«ãããã¤ã
ãªãã§Macã¯ã¢ããªåä½ãªãï¼
ClipMenu
ã¯ãªãããã¼ãã®å±¥æ´ã管çãããã¼ã«ã
Windowsã§ããã¨CLCLã«è¿ããã¹ã¯ãªããã§ã«ã¹ã¿ãã¤ãºãã§ããã
Alfred2
ã³ãã³ãåã®ã©ã³ãã£ã¼ã
ã¯ã¼ã¯ããã¼ã£ã¦ããã®ãä½ã£ãããã¦ã«ã¹ã¿ãã¤ãºã§ããã
ãªããApp Storeã«ãããã¤ã¯v1ç³»ã§å¤ãã®ã§æ³¨æã
Bartender
ã¡ãã¥ã¼ãã¼å³å´ã®ã¢ã¤ã³ã³ï¼Windowsã§ããã¿ã¹ã¯ãã¬ã¤çãªãã¤ï¼ãæ¶ãããããããã¢ããããã¡ãã¥ã¼ãã¼ã«è¿½ããã£ããã§ããããã«ãããã¼ã«ã
常é§ç©ãå¤ã人ã¯ããã¤ããã¨ã¡ãã¥ã¼ãã¼ãã¹ãããªããã
DragonDrop (App Store)
ãã¦ã¹ã§ãã©ãã°ä¸ã®ãã®ï¼ãã¡ã¤ã«ï¼ã¨ããä¸æ¦ç»é¢ä¸ã«ç½®ãã¦ãããããã«ãããã¼ã«ã
ãã¾ã説æã§ããªãã®ã§ãµã¤ãã®åç»è¦ã¦ï½
Synergy
ãããã¯ã¼ã¯è¶ãã«ãã¦ã¹ã¨ãã¼ãã¼ããå
±æãããã¼ã«ã
WindowsãMacãLinuxæ··å¨ã§ã大ä¸å¤«ã
Windowsã¨Macã並ã¹ã¦ç½®ãã¦ã¦ãè¡ã£ããæ¥ããããã®ãé¢åã¨ãã人ã«ããããã
Caffeine (App Store)
Macã®ã¹ãªã¼ããé²æ¢ãããã¼ã«ã
èªå®
ã§ACã¢ããã¿ç¹ãã£ã±ã®æã¨ãããã¡ãã¡ã¹ãªã¼ããã¦ã»ãããªãæã«ãªã³ã«ãã¦ããã
Mountain Lionããã¯caffeinateã£ã¦ããã³ãã³ãã§åæ§ã®ãã¨ãã§ãããã©ããã£ã¡ã¯ã¡ãã¥ã¼ãã¼ã®ãã¿ã³ã¯ã³ã¯ãªãã¯ãªã®ã§ç°¡åã
MuteCon
OSã®èµ·åé³ãæ¶ãã¦ããããã¤ã
æè¿ã¯ã¹ãªã¼ãã§ããéç¨ãã¦ãªããããã¾ããããªãæ°ãããã
åè
- ATOK: å®çªIMEãããã¨æãã¾ãã
- Witch (App Store): ã¦ã£ã³ãã¦åãæ¿ããHyperSwitchãåºã¦ããã¾ã§ã¯ããã ã£ãã
- Pasteboard Recorder: ã¯ãªãããã¼ãå±¥æ´ç®¡çãã¼ã«ã
- LaunchBar: ã³ãã³ãåã®ã©ã³ãã£ã¼ãAlfred2ã«ä¹ãæããã¾ã§ä½¿ã£ã¦ã¾ããã
- QuickSilver: ã³ãã³ãåã®ã©ã³ãã£ã¼ãLaunchBarã«ä¹ãæããã¾ï½
- Growl (App Store): å®çªã®éç¥ã¢ããªãæè¿ã¯éç¥ã»ã³ã¿ã¼ã§ããããªãã¨ãã
ããã
Google Chrome
ãªã«ã¯ã¨ãããã
Firefox
ãã¡ããFirefoxãã
Thunderbird
å®çªã®ã¡ã¼ã©ã¼ã
æ¨æºã®Mail.appã ã¨ä»äºã«ä½¿ãã¥ããã®ã§ã
LimeChat (App Store)
å®çªIRCã¯ã©ã¤ã¢ã³ãã
ãªã«ãã«åç»ã®ãµã ãã¤ã«ã¨ã表示ãããã®ãç´ æµã
夜フクロウ (App Store)
å®çªTwitterã¯ã©ã¤ã¢ã³ãã
Skype
ã¨ããããå
¥ãã¦ãããã
IP Messenger for MacOS X
ä»äºã ã¨ç¸å¤ãããIP Messengerã使ãããâ¦â¦ã
iTerm
å®çªã®ã¿ã¼ããã«ã¯ã©ã¤ã¢ã³ãã
æ¨æºã®Terminal.appãããã£ã¡ã®ã»ãã好ãã
Cyberduck (App Store)
FTPã¨ãSCPã¨ãWebDAVã¨ãS3ã¨ãã®è»¢éã¯ã©ã¤ã¢ã³ãã
å
¬å¼ãµã¤ãã ã¨ç¡æã ãã©ãApp Storeã ã¨2400åããããããè¬ãå¯ä»ãªã®ããªï¼
ãªã³ã©ã¤ã³ãµã¼ãã¹ç³»
Dropbox
Dropboxã®ã¯ã©ã¤ã¢ã³ãã
Evernote (App Store)
Evernoteã®ã¯ã©ã¤ã¢ã³ãã
Skitch (App Store)
ç»é¢ãã£ããã£ãã¼ã«ã
Evernoteã¨ãµã¼ãã¹ãçµ±åãããã
åè
- Google ドライブ: ãã©ã¦ã¶ã§ãã使ã£ã¦ãªãã®ã§å ¥ãã¦ãªãã
ã¨ãã£ã¿
MacVim-KaoriYa
Vimæé«ï¼
Atom
GitHubãåºãã¦ããã¤ãSublime Textã£ã½ãã
Markdown Pro (App Store)
markdownã¨ãã£ã¿ã
æ¿å®ã ã£ããç¡æã ã£ããã®ã»ã¼ã«ã®æã«é£ã³ã¤ããã ãã§æ£ç´ä½¿ã£ã¦ãªãâ¦â¦ï½
Marked (App Store)
markdownã¨ãã£ã¿ã
ãã¡ããã»ã¼ã«ã®æã«ï¼ï½ï½
åè
- Emacs For Mac OS X: Emacsã®ãã¨ã¯ããããããªããã©ããã®ããã±ã¼ã¸ãããã®ããªï¼
- Sublime Text: 人æ°ã®ããã¹ãã¨ãã£ã¿ãPythonã§ã«ã¹ã¿ãã¤ãºãã§ããã
- mi: å®çªããã¹ãã¨ãã£ã¿ããã¤ããã®å®çªã ã£ãã®ãã¯ä¸æã
- CotEditor: å®çªããã¹ãã¨ãã£ã¿ããã¤ããã®å®çªã ã£ãã®ãã¯ä¸æã
- 0xED: ãã¤ããªã¨ãã£ã¿ãå¿ è¦ã«ãªã£ããå ¥ããã
- P4Merge: å®çªã®diffãã¼ã«ãä»ã¯vimã§diffããã®ã§å ¥ãã¦ãªãã
- KDiff3: å®çªã®diffãã¼ã«ã
- Meld: ãããå®çªdiffãã¼ã«ã
ãã¡ã¤ã©ã¼
Path Finder
å®çªã®äºç»é¢ï¼ã¿ããã¡ã¤ã©ã¼ã
ã«ã¹ã¿ãã¤ãºãæè»ã«ã§ããã
ãã¼ãã¤ã³ããèªç±ã«è¨å®ã§ãããã©ããã¼ãã¼ããã¡ã¤ã©ã¼ã®ãããªæä½ä½ç³»ã«ã¾ã§ã¯ã§ããªãã
åè
- ForkLift (App Store): äºç»é¢ãã¡ã¤ã©ã¼ã
- muCommander: Javaã§ã§ãã¦ãã£ã½ãã¯ãã¹ãã©ãããã©ã¼ã ãªç»é¢ãã¡ã¤ã©ã¼ããã¼ãã¼ã主ä½ã
é³æ¥½ï¼åç»
VLC
å®çªåç»ãã¬ã¤ã¤ã¼ã
HUDTube (App Store)
ãã©ã¦ã¶ãããã©ãã°ï¼ããããããURLãåçãããããã¬ã¤ã¤ã¼ã¿ãããªãã¤ã
ã¢ã¼ã«ã¤ã
The Unarchiver (App Store)
å®çªã®ã¢ã¼ã«ã¤ãï¼å±éã®ã¿ï¼ã
ãã¡ã¤ã«åã®ã¨ã³ã³ã¼ãã£ã³ã°ã¨ããæå®ã§ããã
åè
- keka (App Store): å®çªã®å§ç¸®ã»å±éãã¼ã«ãã¢ã¤ã³ã³ããã¢ãï½
- CleanArchiver: ãªã½ã¼ã¹ãã©ã¼ã¯ã ã¨ã.DS_Storeã¨ããé¤å¤ãã¦å§ç¸®ã§ããã
ãªãã£ã¹ã¹ã¤ã¼ã
LibreOffice
MSã¨ããã¨ãããªããã°ãã ãããã¯ããã§è¶³ãã¦ãã
Microsoft Office for Mac
ä»äºã§ã¯ãã£ã¡ãå¿
è¦ã
ã§ãWindowsã¨ããã¨ãããã¨ãã£ã±ãå¾®å¦ã
Keynote (App Store)
Numbers (App Store)
Pages (App Store)
å
iWorkã»ãããKeynoteãã使ã£ã¦ãªãããâ¦â¦ã
éçºç³»
Xcode (App Store)
ããããªãã¨ä½ãã§ããªãã
Homebrew
主ã«ãã«ããã¦ä½¿ãã©ã¤ãã©ãªã¨ããã¼ã«ãå
¥ãã¦ãããããã±ã¼ã¸ããã¼ã¸ã£ã
yumã¨ãaptã¨ãpacmanã¿ãããªãã¤ã
VirtualBox
å®çªã®ä»®æ³åã½ããã¦ã§ã¢ã
主ã«Vagrantã¨çµã¿åããã¦ä½¿ã£ã¦ã¾ãã
VMware Fusion
å®çªã®ä»®æ³åã½ããã¦ã§ã¢ã
Windowsãªã©ã®ãã¹ã¯ãããç°å¢ã¯ãã£ã¡ã§ä½¿ã£ã¦ãã
Vagrant
ä»®æ³ãã·ã³ã宣è¨çãªè¨å®ãã¡ã¤ã«ããä¸çºã§æ§ç¯ãã¦ããããã¤ã
ä»ã®æµè¡ãã
SourceTree
Gitã¨Mercurialã®GUIã¯ã©ã¤ã¢ã³ãã
ã³ãã³ãã©ã¤ã³ã§ããä½æ¥ããªããã©ã人ã«èª¬æããã¨ãã¨ãã«ä½¿ãã
ãªããApp Storeçã¯ãµãã¼ãçµäºã£ã½ãã¦å
¬å¼ãµã¤ãããå
¥ãç´ãã¨è¨ãããã
Eclipse
å®çªIDEã
vimãã使ããªãã®ã§ã©ãã§ããããã©ãEclipseã§äºã
ã¿ãããªè©±ã«ãªã£ãã¨ãã«ä»æ¹ãªã使ãã
Dash (App Store)
APIãªãã¡ã¬ã³ã¹ãªã©ã®ããã°ã©ãã³ã°é¢ä¿ã®ããã¥ã¡ã³ããã¥ã¼ã¢ã
ããããã®ããã¥ã¡ã³ãããµãã¼ãããã¦ãããããã©ãã©ãå¢ãã¦ããã
Apache Directory Studio
LDAPç³»ãã¼ã¿ãã¼ã¹ãGUIã§æä½ã§ãããã¼ã«ã
ãããªã®ã³ãã³ãã©ã¤ã³ã§æä½ãã¦ããã£ãï¼
Robomongo
MongoDBã®GUIã¯ã©ã¤ã¢ã³ãã
è¦ãç®ãã£ãããããã¹ã¯ãªãããå®è¡ã§ãããçµæ§ä¾¿å©ã
åè
- MacPorts: HomebrewãMacPortsããã£ã¦ãããããã®ããã±ã¼ã¸ããã¼ã¸ã£ã
- Parallels Desktop: VMware Fusionã¨äººæ°ãäºåããä»®æ³åã½ããã¦ã§ã¢ã
- IntelliJ IDEA: å®çªIDEãè²ã ããããããï¼ã¾ã 使ã£ããã¨ãªãï¼ã
- NetBeans: å®çªIDEãããã³ããããããã
ãã¶ã¤ã³ç³»
Adobe Photoshop Elements
ãã¶ã¤ã³ã®ãä»äºã¨ãããªãã®ã§Elementsã§ãããã§ãã
GIMP
Photoshopãç¡ãæã¯ãã£ã¡ãã
FireAlpaca
Macã¨Windowsã§ä½¿ããããªã¼ã®ãã¤ã³ããã¼ã«ã
Inkscape
ããã¼ãã¼ã«ã
IllustratorãElementsã¿ãããªã®åºãã¦ããã¾ãããããAdobeããã
Sketch (App Store)
ããã¼ãã¼ã«ã
ã»ã¼ã«ã®æã«ã¨ããããæã«å
¥ããã®ã§ããã¾ã使ã£ã¦ãªãã
Pencil
ã¢ããªã±ã¼ã·ã§ã³ã®ãããã¿ã¤ãã³ã°ãã¼ã«ã
Macã¨ãiPhoneã¨ãã®ã¹ãã³ã·ã«ããã£ã¦ç»é¢ããã¶ã¤ã³ãããã¤ã
ãã®ä»
AppCleaner
ã¢ããªãã¯ãªã¼ã³ã«ã¢ã³ã¤ã³ã¹ãã¼ã«ãããã¼ã«ã
.appã®ã»ãã«é¢é£ããè¨å®ãã¡ã¤ã«ãªã©ãåé¤ãã¦ãããã
TrueCrypt
å®çªã®ãã£ã¹ã¯æå·åãã¼ã«ã
ç©çãã£ã¹ã¯ä»¥å¤ã«ãã¡ã¤ã«ã³ã³ããã§ã®éç¨ãã§ããã®ã§æ°è»½ã«ä½¿ããã
1Password (App Store)
ãã¹ã¯ã¼ã管çã½ãããWindowsãã¹ãã¼ããã©ã³çããã£ã¦åæã§ããã
ãããªãã£ãããã¹ã¯ã¼ãã®ç®¡çã©ãããã®ï¼ã£ã¦ãããã
åè
- Keeper (App Store): ãã¹ã¯ã¼ã管çã½ããã
- KeePass: ãªã¼ãã³ã½ã¼ã¹ã®ãã¹ã¯ã¼ã管çã½ããã
Raspberry Pi(Raspbian)ã«mDNSãè¨å®ãã
Raspberry Piã«ãã£ã¹ãã¬ã¤ããã¼ãã¼ããç¹ããã«é¨å±ã®é
ã£ãã«è»¢ããã¦ããã¦ãªã¢ã¼ãããã¢ã¯ã»ã¹ããã«ã¯ãIPã¢ãã¬ã¹ãç¥ããªãã¨ãããªãããã ãã©ããã£ããã®ãã¼ã¿ãã«ãªRasPiã«åºå®IPã¢ãã¬ã¹ãè¨å®ããã®ãå¾®å¦ãªæããããã®ã§ãmDNSãæ´»ç¨ãã¦ã¿ããã¨ã«ããã
Appleã好ããªã¢ã¬ãã³ã³ãã¥ã¼ã¿å.localã§ã¢ã¯ã»ã¹ã§ãããã¤ã
ã¨ãããããä»åã¯Raspberry Piããªãã¨ããããã£ãã®ã§Raspbianã®å 容ã ãã©ãCentOSã§ãUbuntuã§ãArch Linuxã§ãããã±ã¼ã¸åãéã£ãããããããã§ã ãããåãã
説æã¨ãã©ãã§ããã人åã
# ãã¹ãåããã¡ãã¨è¨å®ãã sudo -e /etc/hostname # avahi-daemonã¨nss-mdnsãã¤ã³ã¹ãã¼ã« sudo apt-get install avahi-daemon libnss-mdns # avahiã«sshãµã¼ãã¹è¿½å sudo -e /etc/avahi/services/ssh.service ä¸èº« ---------------- <?xml version="1.0" standalone='no'?> <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> <service-group> <name replace-wildcards="yes">%h</name> <service> <type>_ssh._tcp</type> <port>22</port> </service> </service-group> ---------------- # åèµ·å sudo reboot
ãã¹ãåã®è¨å®
ã¢ã¯ã»ã¹ããããã®ãã¡ã¤ã³ã"ãã¹ãå.local"ã«ãªãã®ã§ããªã«ã¯ã¨ããããã¹ãåãè¨å®ããã
sudo -e /etc/hostname
paseraspi
avahi-daemonã¨nss-mdnsã®ã¤ã³ã¹ãã¼ã«
sudo apt-get install avahi-daemon libnss-mdns
ã¡ãªã¿ã«avahiãmDNS/DNS-SDã®å®è£
ã§ä¸»ã«responderã¨ãã¦ä½¿ãæã*1ã§ãnss-mdnsã®æ¹ã¯NSSã®hostsã§mDNSã«ããåå解決ããµãã¼ãããããã®ãã©ã°ã¤ã³ã
ãã£ããè¨ãã¨avahi-daemonããã®ãã·ã³ãmDNSã§çºè¦ãã¦ãããããã®ãµã¼ãã§ãnss-mdnsãå¥ã®ãã·ã³ãmDNSã§è¦ã¤ããããã®ã¯ã©ã¤ã¢ã³ãã¿ãããªæãã
ãªã®ã§ãä»åã®ç¨éã ã¨avahi-daemonã ãããã°ããã¦ãRasPiããã©ã£ãã¸.localã§ã¢ã¯ã»ã¹ããæ°ããªããªãlibnss-mdnsã¯ãªãã¦ãããããã
avahiã®è¨å®
/etc/avahi/servicesã«å¿çãããããµã¼ãã¹ã®è¨å®ãã¡ã¤ã«ãä½ãã
ä¾ãã°sshãªããããªæããä¸èº«ã«ã¤ãã¦ã¯man avahi.serviceã§ã
sudo -e /etc/avahi/services/ssh.service
<?xml version="1.0" standalone='no'?> <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> <service-group> <name replace-wildcards="yes">%h</name> <service> <type>_ssh._tcp</type> <port>22</port> </service> </service-group>
ã§ãavahi-daemonåèµ·åã
sudo /etc/init.d/avahi-daemon restart
ãã¨iptablesã¨ãã§ãã¡ã¤ã¢ã¦ã©ã¼ã«ãè¨å®ãã¦ããå ´åã¯ã224.0.0.251:5353å®ã®UDPãéãå¿ è¦ãããã
ããã§"ãã¹ãå.local"ã§Raspberry Piã«ã¢ã¯ã»ã¹ã§ããããã«ãªã£ãã¯ãã
nss-mdnsã®è¨å®
/etc/nsswitch.confã®hostsé ç®ãæ¸ãæãããã ãã©ãã¤ã³ã¹ãã¼ã«ããæç¹ã§èªåçã«æ¸ãæãããã¦ãã¯ãã
sudo -e /etc/nsswitch.conf
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
åèµ·åã¨ãã¯ç¹ã«ãªãã
avahi-browse
avahi-utilsã«å ¥ã£ã¦ãavahi-browseã使ãã¨ãããã¯ã¼ã¯å ã®å©ç¨å¯è½ãªãµã¼ãã¹ãä¸è¦§è¡¨ç¤ºã§ããã
sudo apt-get install avahi-utils
avahi-browse -ar
*1:avahi-browseã¨ãããã
Sassã¨Compassã使ã£ã¦ã¿ã
å®å
¨ã«é
ãã¦ãæããããã©ãä»æ´ãªããã«Sassã¨Compassã®ç°å¢ãæ´ãã¦ã¿ãã
åç½®ãã¨ãã©ãã§ããã人ã¯ãã¤ã³ã¹ãã¼ã«ãã¨ããã®è¾ºã®è¦åºãã ãèªãã§ãã ããã
ã¶ã£ã¡ããgem installã¨compileã¨ãwatchãã¡ããã£ã¨ãã£ã¦ãã ããªã®ã§ãæ¢ã«ä½¿ãããªãã¦ã人ã¯ãã£ã¨ã¿ããéããã¨æéãç¯ç´ã§ãã¾ãã
Sass
Sass - Syntactically Awesome Stylesheets
http://sass-lang.com/
Sassã¯CSSããã£ã¨ä¾¿å©ã§å¹ççã«ã³ã¼ãã£ã³ã°ããããã®æè¡ãCSSã¡ã¿è¨èªã
競åãããã®ã¨ãã¦LESSãStylusããããã©ãæè¿ã¯Compassã¨ã®ã»ããã§Sassãæµè¡ã£ã¦ãæ§åã
Sassã使ãã¨CSSããããªé¢¨ã«æ¸ããããã«ãªãã
/* sass */ $item_color: #3bbfce #navbar width: 80% height: 23px ul list-style-type: none li float: left a color: darken($item_color, 9%)
ãããã³ã³ãã¤ã«ããã¨ä¸ã®ãããªCSSãçæãããã
/* css */ #navbar { width: 80%; height: 23px; } #navbar ul { list-style-type: none; } #navbar ul li { float: left; } #navbar ul li a { color: #2ca2af; }
Sassã¯HamlãSlimã®ãããªã¤ã³ãã³ãã§ãã¹ãã表ç¾ããã
ãã®ä»ã«ãå¤æ°ãé¢æ°ãç¶æ¿ã¨ãã£ãããã°ã©ãã³ã°çãªãã¨ãã§ããã
ããã¨Sassã«ã¯SCSS(Sassy CSS)ã¨ããæ®éã®CSSãæ¡å¼µãããããªè¨æ³ãç¨æããã¦ããã
ã¨ãããSCSSã¯CSS3ã®ã¹ã¼ãã¼ã»ããçãªææ³ã«ãªã£ã¦ãã¦ãæ®éã®CSSã¯SCSSã¨ãã¦ãæ±ãããã®ã§ãã¨ããããæ®éã«CSSã§æ¸ãã¦ãå°ããã¤æ
£ãã¦ããããå ´åã¯SCSSã§æ¸ãã¨è¯ããããããªãã
ã¡ãªã¿ã«ä¸è¨ã®ä¾ãSCSSã§æ¸ãã¨ãããªæãã«ãªãã
$item_color: #3bbfce; #navbar { width: 80%; height: 23px; ul { list-style-type: none; li { float: left; a { color: darken($item_color, 9%) } } } }
ç´°ããæ©è½ã«ã¤ãã¦ã¯å
¬å¼ããã¥ã¢ã«ãè²ã
ãªè§£èª¬ãµã¤ããè¦ã¦ãããã¨ãã¦ãæ©é使ã£ã¦ã¿ãã
ã¤ã³ã¹ãã¼ã«
Sassã¯Rubyã§ã§ãã¦ãã®ã§Rubyãå
¥ã£ã¦ãããã¨ãåæã¨ãªãã
Macãªãæ¨æºã§å
¥ã£ã¦ãããã®ãWindowsãªãå¥éRubyInstallerãªã©ã§å
¥ãããã®ã使ãããã¡ããrbenvã§å
¥ãããã®ã§ãããã
Sassã¯gemã«ãªã£ã¦ãã®ã§æ®éã«gemã³ãã³ãã§ã¤ã³ã¹ãã¼ã«ãã§ããã
sudo gem install sass
ããã§sassã³ãã³ãã使ããããã«ãªãã
sass -v Sass 3.2.10 (Media Mark)
sass -h Usage: sass [options] [INPUT] [OUTPUT] Description: Converts SCSS or Sass files to CSS. Options: : :
ã³ã³ãã¤ã«
sass/scssãã¡ã¤ã«ã®ã³ã³ãã¤ã«ã¯ãããªæãã
sass example.sass example.css
åºåãã¡ã¤ã«ãçç¥ããã¨ç»é¢ã«è¡¨ç¤ºãããã
ä»ã«--style
ã§åºåãããCSSã®å½¢å¼ãå¶å¾¡ã§ããã
ããã©ã«ãã¯nestedã§ãã¤ã³ãã³ããããæãã§åºåãããcompressedã«ããã¨ä¸è¡ã§åºåãããã
ã¡ãªã¿ã«ä¸ã®ä¾ã¯expandedã§åºåããã
ãã¡ã¤ã«ãç·¨éãããèªåçã«ã³ã³ãã¤ã«ãã
--watch
ã¨ãããªãã·ã§ã³ã使ç¨ããã¨ããã¡ã¤ã«ã®å¤æ´ããã£ããèªåçã«ã³ã³ãã¤ã«ãã¦ãããã¢ã¼ãã§èµ·åãã§ããã
å
¥åã¨åºåã¯ã³ãã³ã§åºåã£ã¦æå®ããã®ã§æ³¨æã
# ãã¡ã¤ã«ãæå®ããä¾ sass --watch example.sass:example.css # ãã£ã¬ã¯ããªãæå®ããä¾ sass --watch sass:css
ãã¡ãã¯ãã¡ã¤ã«ã ãã§ãªããã£ã¬ã¯ããªãæå®ã§ããã®ã§ãsass:cssã¨ãæå®ãã¦èµ·åãã¦ããã¨ä¾¿å©ã
ãããèµ·åããç¶æ
ã§sass/example.sassãç·¨éããã¨ãèªåçã«ã³ã³ãã¤ã«ããããã®ãcss/example.cssã«çæãããã
ã¨ããããç°¡åãªä½¿ãæ¹ã¯ãããªã¨ããã
ãã¨ã¯-hãçºããã¨ãããã¥ã¢ã«ãçºããã¨ãã°ã°ãã¨ããã¦æ°ããçºè¦ããããã
Compass
Compass Home | Compass Documentation
http://compass-style.org/
Compassã¯Sassãå©ç¨ããCSSãã¬ã¼ã ã¯ã¼ã¯é(?)ã§ãè²ã ãªmixinéã¨ãã¹ãã©ã¤ãã®èªåçæã¨ã便å©ãªæ©è½ãæã£ããã®ã
ä¾ãã°ãããªæãã«æ¸ãã¨â¦
@import "compass"; .sample { @include border-radius(2px); }
ãããªæãã®CSSã«ãã¦ãããã
/* line 3, ../sass/example.scss */ .sample { -webkit-border-radius: 2px; -moz-border-radius: 2px; -ms-border-radius: 2px; -o-border-radius: 2px; border-radius: 2px; }
ä»ã«ãCSSãªã»ããã¨ãbox-shadowã¨ãè²ã
ãã£ã¦ããããããã³ãã¼ãã¬ãã£ã¯ã¹ã ãã§ãªãã¯ãã¹ãã©ã¦ã¶ãèæ
®ãã¦èªåçã«å¤æãã¦ãããã
ã¹ãã©ã¤ã
ããã«Compassã使ãã¨ã¹ãã©ã¤ãç¨ç»åã¨ããã使ãããã®CSSãèªåçã«çæãã¦ãããã
ãã¨ãã°ãããªæãã«ã¢ã¤ã³ã³ãã¡ã¤ã«ããã£ãã¨ãã¦ã
images/my-icons/new.png images/my-icons/edit.png images/my-icons/save.png images/my-icons/delete.png
ãããªscssãæ¸ãã¨â¦
@import "my-icons/*.png"; @include all-my-icons-sprites;
ãããªç»åãã¡ã¤ã«ã¨cssãçæãããã
images/my-icons-s5dcefb3c8d.png
/* line 66, my-icons/*.png */ .my-icons-sprite, .my-icons-delete, .my-icons-edit, .my-icons-new, .my-icons-save { background: url('/images/my-icons-s5dcefb3c8d.png') no-repeat; } .my-icons-delete { background-position: 0 -32px; } .my-icons-edit { background-position: 0 -64px; } .my-icons-new { background-position: 0 -96px; } .my-icons-save { background-position: 0 0; }
ããé å¼µã£ã¦åãè²¼ããããã¹ãã©ã¤ãçæãµã¤ãã使ããªãã¦ãããï¼
ã»ãã«ããã£ã±ããã£ã±ãæ©è½ããããã©ããããã«ã¤ãã¦ã¯å
¬å¼ããã¥ã¢ã«ãè²ã
ãªè§£èª¬ãµã¤ããè¦ã¦ãããã¨ãã¦ãæ©é使ã£ã¦ã¿ãã
ã¤ã³ã¹ãã¼ã«
CompassãRubyã§ã§ãã¦ãã®ã§Rubyãå
¥ã£ã¦ãããã¨ãåæã¨ãªããã¨ãããSassã使ã£ã¦ãã®ã§å¿
ç¶çã«Rubyã«ãªãã
Macãªãæ¨æºã§å
¥ã£ã¦ãããã®ãWindowsãªãå¥éRubyInstallerï¼ï½ï½
Compassãgemã«ãªã£ã¦ãã®ã§æ®éã«gemã³ãã³ãã§ã¤ã³ã¹ãã¼ã«ãã§ããã
sudo gem install compass
ããã§compassã³ãã³ãã使ããããã«ãªãã
compass -v Compass 0.12.2 (Alnilam) Copyright (c) 2008-2013 Chris Eppstein Released under the MIT License. Compass is charityware. Please make a tax deductable donation for a worthy cause: http://umdf.org/compass
compass -h Usage: compass help [command] Description: The Compass Stylesheet Authoring Framework helps you build and maintain your stylesheets and makes it easy for you to use stylesheet libraries provided by others. : :
ããã¸ã§ã¯ãã®ä½æ
Compassã¯CSSãç»åãªã©ã®ä»ã«ãã¼ã¹URLãã³ã³ãã¤ã«ã®ä»æ¹ãªã©ãè¨å®ãããã¡ã¤ã«ãã»ããã«ãªã£ãããã¸ã§ã¯ããã£ã¬ã¯ããªã§ä½æ¥ãããã¨ã«ãªãã
compass create example1
ããã¨example1ãã£ã¬ã¯ããªã«åæãã¡ã¤ã«ãä½æããã¦ãç°¡åãªä½¿ãæ¹ãªã©ã表示ãããã
directory example1/ directory example1/sass/ directory example1/stylesheets/ create example1/config.rb create example1/sass/screen.scss create example1/sass/print.scss create example1/sass/ie.scss create example1/stylesheets/ie.css create example1/stylesheets/print.css create example1/stylesheets/screen.css ********************************************************************* Congratulations! Your compass project has been created. You may now add and edit sass stylesheets in the sass subdirectory of your project. Sass files beginning with an underscore are called partials and won't be compiled to CSS, but they can be imported into other sass stylesheets. You can configure your project by editing the config.rb configuration file. You must compile your sass stylesheets into CSS when they change. This can be done in one of the following ways: 1. To compile on demand: compass compile [path/to/project] 2. To monitor your project for changes and automatically recompile: compass watch [path/to/project] : :
ã¡ãªã¿ã«--css-dir
ãªã©ã®ãªãã·ã§ã³ã§åºæ¥ä¸ãããã£ã¬ã¯ããªã®ååãªã©ãæå®ããããã§ããã
compass help create
ãã¦ã¿ãã¨è²ã
ãªãªãã·ã§ã³ã®èª¬æãåºã¦ããã
ã¾ãconfig.rbã®ä¸ã«css_dir
ãªã©ã®é
ç®ãæ¸ããã¦ããã®ã§ããããå¤æ´ãã¦ãããã
ã³ã³ãã¤ã«
sassãã£ã¬ã¯ããªã®ä¸ã®ãã¡ã¤ã«ãç·¨éãã¦ãããã¸ã§ã¯ããã£ã¬ã¯ããªã§compile
ãå®è¡ããã¨å
¨ã¦ã®ãã¡ã¤ã«ãã³ã³ãã¤ã«ãã¦cssãã¡ã¤ã«ãä½æãã¦ãããã
sassã³ãã³ãã®æã¿ããã«ãã¡ã¤ã«ããã£ã¬ã¯ããªãæå®ããå¿
è¦ã¯ãªãã
compass compile
ãã¡ã¤ã«ãç·¨éãããèªåçã«ã³ã³ãã¤ã«ãã
Compassãwatch
ã¨ããã³ãã³ãã使ç¨ããã¨ããã¡ã¤ã«ã®å¤æ´ããã£ããèªåçã«ã³ã³ãã¤ã«ãã¦ãããã¢ã¼ãã§èµ·åãã§ããã
compass watch
ãã¡ãããã¡ã¤ã«ããã£ã¬ã¯ããªãæå®ããå¿ è¦ã¯ãªãã
ã¨ããããç°¡åãªä½¿ãæ¹ã¯ãããªã¨ããã
ãã¨ã¯helpãçºããã¨ãããã¥ã¢ã«ãçºããã¨ãã°ã°ãã¨ããã¦æ°ããçºè¦ããããã
ã¡ãªã¿ã«ã³ãã³ãã®ãã«ãã¯help
ã§è¡¨ç¤ºã§ããã
compass help ã³ãã³ã(watchã¨ã)
compass statsã§CSSã®é ç®ãæå¹ã«ãã(2013-09-30追è¨)
stats
ã³ãã³ãã使ãã¨ãããªæ
å ±ã確èªã§ããããcss_parserãå
¥ã£ã¦ãªãå ´åã¯CSSã®é
ç®ãDISABLEDã«ãªã£ã¦ãã¾ãã
ããããå ´åã¯ä¸çªæå¾ã«æ¸ããã¦ããããã«css_parser gemãå
¥ãã¦ãããã¨å¯¾å¿ãããã
compass stats unchanged sass/ie.scss unchanged sass/print.scss unchanged sass/screen.sass unchanged sass/screen.scss | ---------------- | ----- | ---------- | -------------- | ----------- | ------------- | ------------- | -------------- | -------------- | | Filename | Rules | Properties | Mixins Defs | Mixins Used | Filesize | CSS Selectors | CSS Properties | CSS Filesize | | ---------------- | ----- | ---------- | -------------- | ----------- | ------------- | ------------- | -------------- | -------------- | | sass/ie.scss | 0 | 0 | 0 | 0 | 271 B | DISABLED | DISABLED | | sass/print.scss | 0 | 0 | 0 | 0 | 213 B | DISABLED | DISABLED | | sass/screen.sass | 4 | 4 | 0 | 0 | 121 B | DISABLED | DISABLED | | sass/screen.scss | 2 | 1 | 0 | 0 | 341 B | DISABLED | DISABLED | | ---------------- | ----- | ---------- | -------------- | ----------- | ------------- | ------------- | -------------- | -------------- | | Total (4 files): | 6 | 5 | 0 | 0 | 946 B | 0 | 0 | 0 B | | ---------------- | ----- | ---------- | -------------- | ----------- | ------------- | ------------- | -------------- | -------------- | Install css_parser to enable stats on your css files: gem install css_parser
css_parserãå ¥ããã
sudo gem install css_parser
compass stats unchanged sass/ie.scss unchanged sass/print.scss unchanged sass/screen.sass unchanged sass/screen.scss | ---------------- | ----- | ---------- | -------------- | ----------- | ------------- | ------------- | -------------- | -------------- | | Filename | Rules | Properties | Mixins Defs | Mixins Used | Filesize | CSS Selectors | CSS Properties | CSS Filesize | | ---------------- | ----- | ---------- | -------------- | ----------- | ------------- | ------------- | -------------- | -------------- | | sass/ie.scss | 0 | 0 | 0 | 0 | 271 B | 0 | 0 | 271 B | | sass/print.scss | 0 | 0 | 0 | 0 | 213 B | 0 | 0 | 213 B | | sass/screen.sass | 4 | 4 | 0 | 0 | 121 B | 2 | 4 | 185 B | | sass/screen.scss | 2 | 1 | 0 | 0 | 341 B | 2 | 4 | 185 B | | ---------------- | ----- | ---------- | -------------- | ----------- | ------------- | ------------- | -------------- | -------------- | | Total (4 files): | 6 | 5 | 0 | 0 | 946 B | 4 | 8 | 854 B | | ---------------- | ----- | ---------- | -------------- | ----------- | ------------- | ------------- | -------------- | -------------- |
binaryã¸ã®ãã£ã¹ãã£ã¦â¦â¦ï¼
æ¨æ¥ã®「NULLへのキャストって……?」ã§ã¯ã¹ã«ã¼ãããã©ãããã¥ã¢ã«ã®å¼ç¨é¨åã«ãã£ã(binary)
ãæ°ã«ãªã£ã人ãããã¯ãã
使ç¨å¯è½ãªãã£ã¹ãã以ä¸ã«ç¤ºãã¾ãã
- (int), (integer) - æ´æ°ã¸ã®ãã£ã¹ã
- (bool), (boolean) - è«çå¤ã¸ã®ãã£ã¹ã
- (float), (double), (real) - float ã¸ã®ãã£ã¹ã
- (string) - æååã¸ã®ãã£ã¹ã
- (array) - é åã¸ã®ãã£ã¹ã
- (object) - ãªãã¸ã§ã¯ãã¸ã®ãã£ã¹ã
- (unset) - NULL ã¸ã®ãã£ã¹ã (PHP 5)
(binary) ã«ãããã£ã¹ãã b ãã¬ãã£ãã¯ã¹ã®ãµãã¼ãã¯ãPHP 5.2.1 ã§è¿½å ããã¾ããã
ãªã¹ãã«ã¯å ¥ã£ã¦ãªããã©ãæå¾ã«ããã£ã¨ä¸æ追å ããã¦ããã¤ãå ·ä½çãªèª¬æããªã«ãæ¸ããã¦ããªãã®ã§ã©ã使ããã®ãªã®ããã£ã±ãããããªãã
å ã®ããã¥ã¢ã«ã«ã¯ãã®ãããªä¾ãè¼ã£ã¦ããã
ãªãã©ã«æååãå¤æ°ãããã¤ããªæååã«ãã£ã¹ããã¾ãã<?php $binary = (binary) $string; $binary = b"binary string"; ?>
ããããPHPã®æååã¯å
ããï¼å
é¨ã¨ã³ã³ã¼ãã£ã³ã°ãªã©ãæããªãï¼ãã ã®ãã¤ãå*1ãªã®ã§ããããããã£ã¹ãããæå³ãããããªãã
試ãã«ãããªãã¨ããã¦ã¿ããããªã«ãå¤ãã£ãããã«ã¯è¦ããªãã
<?php var_dump('ããã«ã¡ã¯'); // string(15) "ããã«ã¡ã¯" var_dump(b'ããã«ã¡ã¯'); // string(15) "ããã«ã¡ã¯" var_dump((binary)'ããã«ã¡ã¯'); // string(15) "ããã«ã¡ã¯" var_dump('ããã«ã¡ã¯' === (binary)'ããã«ã¡ã¯'); // bool(true) var_dump('ããã«ã¡ã¯' === b'ããã«ã¡ã¯'); // bool(true) ?>
å®éãã¡ããã©æå ã«ãã£ãPHP 5.4.13ã®zend_language_scanner.lã§ã¯ãã®ããã«å®ç¾©ããã¦ããã
<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}("string"|"binary"){TABS_AND_SPACES}")" { return T_STRING_CAST; }
å®ã¯PHP6ã¸ã®å¸ç³ã ã£ãï¼
ã©ãããããï¼ãã¤ã¦ã®æ§æ³ã®ï¼PHP6ã§å
é¨å®è£
ãUnicodeã«ãªããã¨ã¸ã®å¸ç³ã ã£ãããã§ãç¾å¨ã§ã¯ç¹ã«æå³ãç¡ãã£ã½ãã
Unicodeæååãããã©ã«ãã«ãªã£ãæã«ãã¤ãåã表ç¾ããããã«ç¨æããã¦ãããã®ãããã
ãããPHP6ã§ã®Unicodeåã¯æ念ãã¦ç¾å¨ã®5.3ãã®éãæ©ãã§ãã®ã§â¦â¦ãããªãåï¼
åè
NULLã¸ã®ãã£ã¹ãã£ã¦â¦â¦ï¼
PHPã®åãã£ã¹ãã¯(array)
ã¨ã(object)
ã¨ãå¤æ
çãªã®ããããã©ãæè¿(unset)
ãªããã®ãåå¨ãããã¨ã«æ°ã¥ããã
unset($var)
ã®ãã¨ã§ã¯ãªãã(unset)$var
ã ã
使ç¨å¯è½ãªãã£ã¹ãã以ä¸ã«ç¤ºãã¾ãã
- (int), (integer) - æ´æ°ã¸ã®ãã£ã¹ã
- (bool), (boolean) - è«çå¤ã¸ã®ãã£ã¹ã
- (float), (double), (real) - float ã¸ã®ãã£ã¹ã
- (string) - æååã¸ã®ãã£ã¹ã
- (array) - é åã¸ã®ãã£ã¹ã
- (object) - ãªãã¸ã§ã¯ãã¸ã®ãã£ã¹ã
- (unset) - NULL ã¸ã®ãã£ã¹ã (PHP 5)
(binary) ã«ãããã£ã¹ãã b ãã¬ãã£ãã¯ã¹ã®ãµãã¼ãã¯ãPHP 5.2.1 ã§è¿½å ããã¾ããã
NULLã¸ã®ãã£ã¹ãï¼
<?php $foo = 'test'; $bar = (unset)$foo; var_dump($bar); // NULL var_dump((unset)'string'); // NULL var_dump((unset)12345); // NULL var_dump((unset)true); // NULL var_dump((unset)null); // NULL var_dump((unset)(new StdClass)); // NULL ?>
ãªãã»ã©ãNULLã«ãªããªã
ã§ãããä½ã«ä½¿ãã®ï¼ï¼
<?php $bar = NULL; ?>
ããã ããªãã§ããï¼ï¼
ã°ã°ã£ã¦ãunset()
ã®ãã¨ã°ããåºã¦ãã¦èª¿ã¹ãã®ã大å¤ãªãã ãã©ãStack Overflowã§2件ã»ã©åæ§ã®çåãæããããæ稿ãè¦ã¤ãã£ãã
- Anyone ever used PHP's (unset) casting? - Stack Overflow
- In PHP, what purpose does (unset) have? - Stack Overflow
åçã®ä¸ã«ã¯ãããªä¾ãåºã¦ãããã©ãããããããæ¸ãçç±ãããããªãããåçè èªèº«ãå«ãã¦ããã¼ãããªæãã§çµãã£ã¦ã模æ§ã
<?php $foo = bar((unset) baz()); ?>
<?php function fallback() { // some stuff here return 'zoo'; } var_dump(false ? 'foo' : fallback()); // zoo var_dump(false ? 'foo' : (unset) fallback()); // null ?>
ã½ã¼ã¹ã³ã¼ããã¡ãã£ã¨è¦ã¦ã¿ããã©ãåï¼ï¼ï¼ã®åã ã*1ã¨ãããããã£ã¹ãç¨æãã¦ããã¾ããæãããªãã¦æå³ãããããããªãã£ãã
(array)$var
ã¡ãªã¿ã«(array)
ã¯ãããªæãã
ãªãã¸ã§ã¯ãã¨NULLãé¤ãã¦ãèªèº«ãè¦ç´ ã«æã¤é
åã«ãªãã
<?php class Foo { public $x = 10; protected $y = 20; private $z = 30; function foo() {} } $foo = new Foo; var_dump((array)'string'); // (1) var_dump((array)123); // (2) var_dump((array)true); // (3) var_dump((array)array(10, 20, 30)); // (4) var_dump((array)array('x' => 10, 'y' => 20)); // (5) var_dump((array)$foo); // (6) var_dump((array)null); // (7) ?>
array(1) { // (1) [0] => string(6) "string" } array(1) { // (2) [0] => int(123) } array(1) { // (3) [0] => bool(true) } array(3) { // (4) [0] => int(10) [1] => int(20) [2] => int(30) } array(2) { // (5) 'x' => int(10) 'y' => int(20) } array(3) { // (6) 'x' => int(10) '\0*\0y' => int(20) '\0Foo\0z' => int(20) } array(0) { } // (7)
NULLã¯èªèº«ãå¤ã«æã¤é
åã§ã¯ãªãã¦ã空é
åã«ãªãã
ãªãã¸ã§ã¯ãã¯ãªããé¢åãªãã¨ã«ãªãã®ã§é¿ããã»ããããã
ããããæãã§ã1åã®æã¯ã¹ã«ã©å¤ã§ã渡ããé¢æ°â¦ã¿ãããªãã¤ã§ææè¦ãããã
<?php function do_something($item) { foreach ((array)$item as $x) { echo $x; } } do_something('foo'); do_something(array('foo', 'bar', 'baz')); ?>
(object)$var
(object)
ã¯ãããªæãã
<?php var_dump((object)'string'); // (1) var_dump((object)123); // (2) var_dump((object)true); // (3) var_dump((object)array(10, 20, 30)); // (4) var_dump((object)array('x' => 10, 'y' => 20)); // (5) var_dump((object)$foo); // (6) var_dump((object)null); // (7) ?>
class stdClass#1 (1) { // (1) public $scalar => string(6) "string" } class stdClass#1 (1) { // (2) public $scalar => int(123) } class stdClass#1 (1) { // (3) public $scalar => bool(true) } class stdClass#1 (3) { // (4) int(10) int(20) int(30) } class stdClass#2 (2) { // (5) public $x => int(10) public $y => int(20) } class Foo#1 (3) { // (6) public $x => int(10) protected $y => int(20) private $z => int(30) } class stdClass#1 (0) { } // (7)
stdClassã®ã¤ã³ã¹ã¿ã³ã¹ã«ãªãã
ãªãã¸ã§ã¯ãã¯ãã®ã¾ã¾ã
é£æ³é
åã¯ããããã©ãæ®éã®é
åã¯ã©ãããç¶æ³ãªã®ãããããããªãã
ã¨ãããé£æ³é
åããã¼ã«ãã£ã¦ã¯ãã°ãæããããã
<?php var_dump((object)array('x a b' => 10, 'ã¦ãã¨' => 20)); ?>
class stdClass#2 (2) { public $x a b => int(10) public $ã¦ã㨠=> int(20) }
ãªãã¸ã§ã¯ãããªãã¸ã§ã¯ãã«å¤æãããå ´åãããã¯ä¿®æ£ããã¾ããã ä»ã®åã®å¤ããªãã¸ã§ã¯ãã«å¤æãããå ´åããã«ãã¤ã³ã¯ã©ã¹ã§ãã stdClass ã®æ°ããã¤ã³ã¹ã¿ã³ã¹ãçæããã¾ãã å¤ã null ã®å ´åãæ°ããã¤ã³ã¹ã¿ã³ã¹ã¯ç©ºã¨ãªãã¾ãã é åããªãã¸ã§ã¯ãã«å¤æãããå ´åãé åã®ãã¼ãããããã£åã¨ãªãã é åã®å¤ãããããã£ã®å¤ã¨ãªãã¾ããä»ã®å¤ã®å ´åã scalar ã¨ããååã®ã¡ã³ãå¤æ°ãå¤ãæ ¼ç´ãã¾ãã
*1:resourceåãªã©ã¯ãªãã£ãã
plenvã¨pyenvã«ä¹ãæãã
ä»ã¾ã§Perlã¯perlbrewãPythonã¯pythonbrewã使ã£ã¦ããã®ã ãã©ãæè¿ãªãã¨ãenvã¿ãããªã®ãæµè¡ã£ã¦ããããã®ã§ä¹ãæãã¦ã¿ãã
ä¹ãæãåæ©
- pythonbrewã¯ã¡ã³ããã³ã¹ãããªããªã£ãããã*1
- Rubyã§rbenvã使ã£ã¦ãã®ã§åããããªãã¤ã§æããã
plenv
https://github.com/tokuhirom/plenv
åºæ¬çã«ã¯INSTALLATIONã®éãã«ããã°ãããrbenvãªããã¨åãã
ãã ãCentOS6ã«å
¥ãããã¨ããããplenvãåããã¦ãã·ã¹ãã ã®Perlã®Module::Metadataversion.pmãå¤ãã£ããããã¦ã¨ã©ã¼ãåºãã®ã§ãããã ãæ°ããå
¥ãç´ãå¿
è¦ããã£ããï¼23:11è¨æ£ï¼
# CentOS6ã®å ´å $ sudo yum install perl-CPAN $ sudo cpan version # cloneãã¦ãã¦ã·ã§ã«ã®è¨å®ã«è¿½å $ git clone git://github.com/tokuhirom/plenv.git ~/.plenv $ echo 'export PATH="$HOME/.plenv/bin:$PATH"' >> ~/.zprofile $ echo 'eval "$(plenv init -)"' >> ~/.zshrc # ã·ã§ã«ãèµ·åãç´ã $ exec $SHELL -l
è¨å®é¨åã¯æ¨¡ç¯çãªæãã§æ¸ãããã©ãåèªã®ç°å¢ã«åããã¦è¨å®ããã
èªåã®å ´å.zshenvã¨ãã§è²ã
ä»æããã¦ããããã®ã§ä¸è¨ã®ããã«ã¯ããªãã£ãã
ãã§ãã¨ãããã使ã£ã¦ã¿ãã
$ plenv available
perl-5.17.8
perl-5.16.2
perl-5.14.3
perl-5.12.5
perl-5.10.1
perl-5.8.9
perl-5.6.2
perl5.005_04
perl5.004_05
perl5.003_07
$ plenv install 5.16.2
$ plenv global 5.16.2
# cpanmãã³ãã³ãä¸çºã§å
¥ãã¦ãããããã
$ plenv install-cpanm
$ plenv rehash
plenv migrate-modulesã§ã¢ã¸ã¥ã¼ã«ãå¥ç°å¢ã«ç§»è¡ã§ããã便å©ããã
carton
https://github.com/miyagawa/carton
Rubyã§ããã¨ããã®Bundlerã®ãããªãã¤ã
ããã¸ã§ã¯ãï¼ãã£ã¬ã¯ããªï¼æ¯ã«ã¢ã¸ã¥ã¼ã«ã®ã¤ã³ã¹ãã¼ã«ã¨ãã¼ã¸ã§ã³ã®åºå®ãã§ããã
$ cpanm Module::Install carton $ plenv rehash
ã§ããªãããããªMakefile.PLãæ¸ãã¨ãã¦ã
use inc::Module::Install; name 'MyApp'; version '1.0'; requires 'Plack', 0.9980; requires 'Starman', 0.2000; WriteAll;
$ carton install
ã¨ãããã¨./local以ä¸ã«ã¤ã³ã¹ãã¼ã«ããã¦ãcarton.lockãçæãããã
$ carton install JSON
ã¿ããã«ç´æ¥ã¤ã³ã¹ãã¼ã«ãããã¨ãã§ããã
pyenv
ã¤ã¥ãã¦Pythonããã¡ããã¤ã³ã¹ãã¼ã«æé ã¯ã»ã¼åãã
# cloneãã¦ãã¦ã·ã§ã«ã®è¨å®ã«è¿½å $ git clone git://github.com/yyuu/pyenv.git .pyenv $ echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.zprofile $ echo 'eval "$(pyenv init -)"' >> ~/.zshrc # ã·ã§ã«ãèµ·åãç´ã $ exec $SHELL -l
使ã£ã¦ã¿ãã
$ pyenv install -l Available versions: 2.5 2.5.1 2.5.2 : : # ã¤ã³ã¹ãã¼ã«ãdistributeã¨pipãå ¥ãã¦ããã $ pyenv install 3.3.0 $ pyenv gloabl 3.3.0
virtualenv
https://github.com/yyuu/pyenv-virtualenv
ãã¨virtualenvãpyenvã®ãã©ã°ã¤ã³åãããã¤ãããã®ã§ãã¤ãã§ã«å ¥ãã¦ããã
$ cd ~/.pyenv/plugins
$ git clone git://github.com/yyuu/pyenv-virtualenv.git
pyenv virtualenvã³ãã³ããå¢ããã®ã§ãããã§ç°å¢ãä½ããããã«ãªãã
$ pyenv virtualenv --distribute 3.3.0 env330
.pyenv/versionsã®ä¸ã«æå®ããååã§ã§ããã®ã§ãããã«åãæ¿ãã¦ä½¿ããã¨ã«ãªãã¿ããã
$ ls ~/.pyenv/versions 3.3.0/ env330/ $ mkdir projA $ cd projA $ pyenv local env330
ä¼¼ããããªã®å¢ãã¦ãã
ã¨ããããã§ãrbenv, plenv, pyenvã®ç°å¢ãåºæ¥ä¸ãã£ãã
rbenvã¨pyenvã¯ä¼¼ã¦ããã©ãplenvã¯ä¸èº«ã¯çµæ§éã£ã¦ãå°è±¡ã
ãããããã®æã®ãã¤ã©ãã©ãå¢ãã¦ãããã©ãçµ±åçãªä»çµã¿ä½ã£ã¦ãåè¨èªç¨ã®ã¬ã¤ã¤ã追å ãã¦ãã£ã¦â¦â¦ã¿ãããªå½¢ã«ã§ããªãããªãã
Twitterã§èª°ãããllenv init ruby perl pythonã¿ããã«åºæ¥ãã°ããã®ã«ãã¿ãããªãã¨è¨ã£ã¦ããã
*1:ä»ã¯pythonzã£ã¦ããforkãªã®ããªï¼