2015-01-01ãã1ã¶æéã®è¨äºä¸è¦§
HTML ã®è¦ç´ ãåãåºãããã®ããXpathãä½ããã /html/body/div[5]/div/div[2]/div/div/div/div/article[3]/div/footer/div[4] ã¿ãããªãXPATHãåãåºãã¦ãããã node = Nokogiri::HTML( html_doc ).search("#footer") # ãã¼ããåå¾ãã㨠node.pathâ¦
SMTP over SSL ã使ã SMTP Over SSL ã¯ä¸è¬çã« ãã¼ã465 ã§æä¾ããã if ARGV.size != 3 puts "usage : \n " puts " $ "+ __FILE__ + " [email protected] 'test mail' ' hello ' " puts " \n\n " exit end require 'mail' options = { :address => "smâ¦
åç»ã®ã¢ã¹ãã¯ãæ¯ãä¿ã£ãã¾ã¾ãç¹å®ã®å¹ ã«çµ±ä¸ããã ãã«HDã®åç»ãiPhoneã«è»¢éããããã©ã容é足ãããã ãã¥ã¼ã¸ãã¯ã»ãããªãªã®ã§ãåç»ã®ãµã¤ãºãããç¨åº¦ã«çµ±ä¸ãã¦ãåç»ã®æ¨ªå¹ ããçµ±ä¸ãã¦ãã¾ãã°ããã¡ã¤ã«ãµã¤ãºã¯å°ãããªãã ãµã¤ãºãã¾â¦
ã¿ãªã¨éè¡ãããä¼ç å£åº§éç¥ãæ¥ã ã¿ãªã¨éè¡ããä¼ç å£åº§ã«ç§»è¡ãããï¼ã£ã¦éç¥ãæ¥ãã®ã§ã ãã°ã¤ã³ãã¦ãã¹ã¯ã¼ããåè¨å®ãã¦æ®é«ç §ä¼ããããã¨ãããã»ã»ã» ãã¹ã¯ã¼ãã¯ï¼ãï¼ï¼æåã§ãã£ã¦ å®æçå¤æ´ãå¼ã³ãããåã«ã§ããäºããããã㪠ãâ¦
hashã£ã¦ãªã«ï¼ èµ·åããã³ãã³ãããä½å¦ã«ãã£ãã®ããï¼åç®ä»¥éã®PATHæ¤ç´¢ãçç¥ããæ©è½ã§ãã PATHç°å¢å¤æ°ãå¤ããå¾ãã³ãã³ãè¡æ¹ä¸æâhashã«ãããã£ãã·ã¥ PATHãããã£ãå¾ã«ãã³ãã³ãã®å ´æå¤æ´ããåæ ãããªããã¨ã£ã¦ãããã #bashã®å ´æâ¦
æ¥æ¬èªï¼ç©ºç½ãã¡ã¤ã«åã鬱é¶ãã OSXã®ã¹ã¯ãªã¼ã³ã·ã§ããã¯ãããã便å©ï¼ æ¥æ¬èªãã¡ã¤ã«åã§ã空ç½ãå«ããã¡ã¤ã«åã§ãããã¨ãé¤ãã¦ã¯ã æ¥æ¬èªãã¡ã¤ã«åããªãã¨ããã æ¥æ¬èªãã¡ã¤ã«åã¯ãç°¡åã«ä½ã¨ããããã¨ãã§ããããã°ã°ã£ã¦ããã«è¦ã¤ãâ¦
man ãèªããªãã³ãã³ãããã HomeBrew ã§å ¥ããã³ãã³ãã§ãèªããªã man ãããã takuya@rena:~/Desktop$ man nmap /usr/bin/groff: can't find `DESC' file /usr/bin/groff:fatal error: invalid device `nippon' takuya@rena:~/Desktop$ ãã®ã¾ã¾ã§ã¯â¦
sudo ã§ãã¡ã¤ã«è§¦ãã¨ãã«ä¾¿å©ãª sudoedit sudo -e /etc/apache2/users/takuya.conf ã¡ãã£ã¨ãã¡ã¤ã«ç·¨éããããã¨ãã«ä¸ä¾¿ã ã£ãããã¾ããããvim ã¨ãèµ·åãããç°å¢å¤æ°ãã¢ã¬ã§ã³ã¬ã§ãã ãããªæã«ä¾¿å©ãªã®ã sudo -e ãã¡ã¤ã«å ã³ã¬ã¯ç¥ããªãã£â¦
ãã¶ãéè¡ã®æ°å¤è¡¨ã®èªåå ¥åãä½ã£ã æ¯ãè¾¼ãã®ã«ãä¹±æ°è¡¨å ¥ãã¦ãã¨ãã©ããé¢åãããã ä¹±æ°è¡¨ãä½ãããããªããå©ç¨è å´ã§ï¼ï¼ï¼æåãããã®ãã¹ã¯ã¼ããå®æçã«å¤æ´ã§ããããã«ãã¦æ¬²ããããã ããã ä¹±æ°è¡¨ãèªåã§å ¥åããããã«ä½ã£ã¦ãããâ¦
ãªã¬ãªã¬è©æ¬ºãé²æ¢ãããï¼ãè¦é£½ãã ãã¡ãã£ã¨ã¾ã£ã¦ãªã¬ãªã¬è©æ¬ºãããï¼ãã¨ããããå®å ¨ã«ããä¸å¿«ãªåçºãã¹ã¿ã¼ã§ãã ã³ã¬ã»ã©ãã¹ã¿ã¼ãå¤ããã°ããªãªã«ãå°å¹´ã«ãªã£ã¦ãã¾ããç§ãã£ã¦ãã¨ãå¤ããªããã ãªã¬ãªã¬è©æ¬ºã¯ãªãèµ·ããã®ãï¼ ï¼ï¼â¦
ã¿ã¹ã¯ã»ã«ã³ãã³ã§å¯è¦åã£ã¦ä¾¿å©ããã ã¿ã¹ã¯ã«ã³ãã³ã£ã¦ã®ã¯ãå¯è¦åã¨ãã¦åªç§ãããã ã§ãããã¹ãã¤ããæ¸ãã®é¢åã ãã ã¿ã¹ã¯ã»ã«ã³ãã³ã£ã¦ç§ããã£ããã¨ãããã ãã©ãçæ¿ã«è²¼ãã ããã¹ãã¤ããã®åãæ±ãã¦ãã©ããã¿ã¹ã¯ã«ã³ãã³ã£ã¦ä¾¿å©â¦
ruby ã§PDFãèªç±èªå¨ã«æ±ããããã«ãªããã pdf ãæ±ããã¨ããã£ã¨ä¾¿å©ãªãã ãã HTML ã®å°å·ãã¡ãã£ã¨çµ¶æçããã¦ããã print.css ã«ãã¦ããã¹ã±ã¼ã©ããªãã£ãèæ¯ç»åã®åé¡ã ã¨ããç»é¢ã«ã¤ãã¦ã¯ããªãé£ãã ããã¸ã§ã¯ã¿ã¼ç¨ã«åºåãããã¨ãâ¦
æ»ããã¿ã³ç¦æ¢ã£ã¦ä½ã¨ããªããªãã®ããªã ã½ãã¼æä¿ ã»ãã·ã§ã³ããã£ã¡ã管çããã°å¤§ä¸å¤«ã ã¨æããã ãã©ã POSTæ¥ã¦ããããã®æã®POSTã§ããã ãããã ãã¨ãã°ããCSRFã¨ããããã対çãããã ãããã©ããã¼ã¸ã®ç¶æ ãä¿åããä»çµã¿ããã£ã¡ãâ¦
Google ãå好ãå¦ç¿ãã¦å°ã ã¬ã´ã¹ããªã³ããæ¤ç´¢ãã¦ãã½ãããã³ã¯ï¼ã¹ããªã³ãã®æ¤ç´¢çµæãä¸ã®æ¹ã«æ¥ãæã«è¾æããã æºå¸¯é»è©±ã«ã¤ãã¦èª¿ã¹ã¾ãã£ãå¾ã ã£ãã®ã§ãããããçµæã«ãªã£ããã ã¨æããã©ã ãããããæ¤ç´¢ã«å ¥ãããã¼ã¯ã¼ããï¼ã¤ï¼ã¤â¦
ãªã³ã¯åãã¨ããä»ã©ãèµ·ããªãããã»ã»ã» ã¨æã£ã¦ãææããããã«ãããã¾ããããããå®éã«ãªã³ã¯åããèµ·ãããã ããä»æ¹ãªãã 404 ãã§ãã«ã¼ãwget ã® spider æ©è½ã§å®ç¾ãã wget --spider -o ~/wget.log -e robots=off -r -p http://www.examplâ¦
wget ã¯ãã«ã£ã¨å¦çããã®ã«ä¾¿å©ã wget -r http://takuya-1st.hatenablog.jp/ ããã ã åºåã¯ãã¡ã¤ã³åã®ãã©ã«ãã«åºã¦ãã ãã¨ãã°ããããªãããã«ããªã³ã¯ã辿ã£ã¦ãHTMLãä¿åãã¦ããããã¡ãªã¿ã«ç»åã¨ãå¥ãã¡ã¤ã³ã¸ã®ãªã³ã¯ã¯ããã®ã¾ã¾ã ã¨ä¿â¦
ãã¾ã©ãã® bashãªã ãã¹åå±éãåºæ¥ãã zsh ãªãã¦ãbashã§ãã大ä¸å¤«ã shopt -s globstar ã³ã¬æ¸ãã ãã ããã¨ãé層ããã©ã£ã¦å±éããã ãããªæã takuya@rena:~/repos/my_command$ ls -l **/*.rb -rwxr-xr-x 1 takuya staff 459 7 4 2014 cygwiâ¦
bash4.x ã«ã¯globstarããã£ã¦ ls **/*.php ã¨ããfindãªãã§ãå帰çã«ãã¡ã¤ã«ãGlobãããã¨ãåºæ¥ããããããglobstarãåããªãã£ãã®ã§ããããã¨æã£ã¦èª¿ã¹ã¦ããã bash 4.x ã使ã£ã¦ããã®ãã確èªããã¨ããã ãããã®ã¿ã¼ããã«ç°å¢ã«ã¯ãbash â¦
iPhone5/5c/5s iPad mini / mini2 ã使ã£ã¦ããã ããããã±ã¼ãã«ãã»ã» ã©ã¤ããã³ã°ã±ã¼ãã«ã£ã¦ãæ²¹æãã¦ãã¨ã¨æç·ãããããã å é»ã¹ã¿ã³ãã£ã¦çµæ§ãããã æºã®ä¸ã«ãå é»ã¹ã¿ã³ããç½®ãã¦ãiPhoneãå é»ããã¡ãªãããããã¾ãã å é»å°ãå°å ¥ãâ¦
graphviz ã¨ããæåã°ã©ãã使ãã®ã«æé©ãªãã¼ã«ãæãã¾ã㦠ããã¹ãã»ã¨ãã£ã¿ã§ãã¢ã¹ãã¼ã¢ã¼ããæãããã«æ¸ãä¸ãã¦ããã°ãããããªå³ã«ãªãã®ã§ã楽ããããããããããã¹ããã¡ã¤ã«ãªã®ã§ãå·®åã®ç¢ºèªãGit管çã§ãããã¨ãã§ããã®ã§ä¾¿å©ããâ¦
ãã³ã¢ã®Myãã³ã¢ããJSãªãã§åããªãã»ã»ã» é å¼µãã°ãåããã ãããã©ãMechanizeã§ç²å¼ããã®ãé¢åã ãã ãã³ã¢ã®è«æ±æ¸ ã¹ã¯ã¬ã¼ãã¼ gistca3730a603be61927d34 å¿ è¦ãªãã® pdfé¢é£ watir brew install pdftk qdf gem install watir watir-webdriverâ¦
ã½ãããã³ã¯ã®ãã°ã¤ã³ç»é¢ã®ãçµµåãããããããã¬ã¤ãªæãããã ãã®çµµåããã®å¾å´æããã ä½ã ãã®ãã¤é¡ã£ã½ãçµµåããã¯ãHTML5ã®Canvasã«è»¢éãã¦ãç»åãèªèããã°HTMLã ãã§ãããã¯åºæ¥ãããããããã¦ãããããªã®ãã¹ã¯ã·ã§åã£ã¦ãç»ååâ¦
ãªããä¸éã¯ãIDçªå·ã«æå³ã¥ãããã®ã ããã IDã¯ç¡å³ä¹¾ç¥ãªé£çªã§ã¤ã¤ã¨ããããã§ãã IDã®æ°åã«æå³ãããããã®ã¯ããã¦ã¼ã¶ã¼ã¤ã³ã¿ã¼ãã§ã¼ã¹ãã§ãã£ã¦ãããèªä½ãå人æ å ±ã«ãªã£ã¦ããã»ã»ã» å 許証çªå·ã«æããããæå³ å 許証çªå·ã¯ã å ¬å®çªâ¦
XCODEãå ¥ããã¨ãdiff ã³ãã³ããã¤ãã¦ãã opendiff textA textB ã¨ããã³ãã³ãã§ãå·®åã¨ãã¼ã¸ãã§ããããã«ãªãã å®æ ã¯ãFileMergeã¨ããã³ãã³ã Xcodeã®utilities ã«å«ã¾ããã git ã³ãã³ãã§ä½¿ãã«ã¯ [merge] tool = opendiff vimdiff ãæå¼·â¦
sql 㧠ãã¡ãã¡ group by count ããã®é¢å ãã¼ãã«ä½ã£ã¦ã¼ create table words ( word text ) ; ãã¼ã¿æå ¥ãã¦ã¼ insert into words values ( "aaaa" ) ; .. éè¨ã㦠select word, count(*) as from words group by word order by cnt desc ; ãï¼ããâ¦
Sublime Textã«ãã¼ã¹ãããã¨ãã¡ã¤ã«åã«ãªãã iTermã®ããã«ããã«ãã¹ã§è²¼ãä»ããã iTermãªãããã¼ã¹ãããã«ãã¹ã«ãªããããï¼Sublime Text ã§ãåããã¨ããããã£ããã§ããã ã¯ãªãããã¼ãã«ãããã¼ã¿ã®ãã«ãã¹ãåå¾ããå¿ è¦ãããã OSXâ¦
rbenv çµç±ã® ruby ã¯é ãã»ã»ã» takuya@rena:~/Desktop$ time rbenv exec ruby -e "puts 1" 1 real 0m1.012s user 0m0.511s sys 0m0.392s é常ã«é ãã¨ããããã§ã¯ãªãããã ãã¶ãããã OSX ã® ruby ã¯ãããããéã takuya@rena:~/Desktop$ time /usr/â¦
X11 ãå ¥ããªããããã©è§£æ±ºããªãã£ãã takuya@atom:~$ palimpsest /private/tmp/com.apple.launchd.vD7U6lpFQL/org.macosforge.xquartz: unknown host. (nodename nor servname provided, or not known) ãã£ã¹ãã¬ã¤ããªã¼ãã³ã§ãã¾ãã: ã¨ãªã£ã¦ãX â¦
ãã¤ãã®ã½ããã¦ã§ã¢ãã¤ã³ã¹ãã¼ã«ããã®ã«ç²å´ã Boxen ãããã®ã¯ç¥ã£ã¦ããã ãã©ã»ã»ã»Boxenã¯ãã¾ãé¢åãå¢ãããããªã®ã§ã è¦ãããã¨ãå°ãªãæ¹æ³ããªãããªããªã㦠brew install xquartz ã¨ãã§ãããããã®ã«ãªãã£ã¦ãã£ã¨æã£ã¦ã¾ããã Casâ¦
Windows ãªãå³ã¯ãªãã¯ããã°ãPathã§ã³ãã¼ Windowsãªããå³ã¯ãªãã¯ï¼Shift ã§ãã¹ã§ã³ãã¼ ããOSXã§ããããããï¼ã®ã§ãã£ãã è¶ ç°¡åãªã®ã§ãä½ã£ã¦ã¿ããAutomatorã§ããä½ããã å³ã¯ãªãã¯ã¡ãã¥ã¼ã§ããã¹ã§ã³ãã¼ã§ããã®ã§ãããã¹ãã¨ãã£ã¿ã«â¦