2012-03-01ãã1ã¶æéã®è¨äºä¸è¦§
JSã§RSAæå·ã使ãããã¤ä½¿ã£ã¦ã¿ã http://cryptico.wwwtyro.net/éµä½ã var pass = 'kazusuke'; var rsa_key = cryptico.generateRSAKey(pass, 1024); var pub_key = cryptico.publicKeyString(rsa_key); 'hello'ãæå·å var enc = cryptico.encrypt('helâ¦
Macã¯ãã¡ã¤ã«ãä½æãããæã«ãã©ã«ãã¢ã¯ã·ã§ã³ãå®è¡ã§ãã ãã©ã«ãã¢ã¯ã·ã§ã³ã¯Automatorã§ä½ãã Automatorããshell scriptãå®è¡ã§ãã ãã©ã«ãã¢ã¯ã·ã§ã³ãä½ã£ã automatorå ã®shellscriptããã¯ã³ã©ã¤ãã¼ãå¼ã³åºã /usr/bin/ruby -rubygems -â¦
é貨ã¿ãããªè¡¨ç¤º 1234567890.to_s.reverse.split(/(\d{3})/).select{|i|i.size>0}.join(',').reverse => "1,234,567,890"1234567890.to_s.reverse.gsub(/(\d{3})/,'\1,').reverse => "1,234,567,890"
sipsã£ã¦ããã³ãã³ãã©ã¤ã³ãã¼ã«ãMacã«å ¥ã£ã¦ããã®ã§ãããã使ãã¨ããä½ãã sips -s format icns icon.png -z 128 128 --out appIcon.icns
æ°ããMacããgit pushããã remote: *** Project description file hasn't been set remote: error: hook declined to update refs/heads/master ! [remote rejected] master -> master (hook declined)ããããã¨ã©ã¼ãã§ã¦pushã§ããªãããªã¢ã¼ããªãã¸â¦
rvm default do ruby hoge.rbã¨ã rvm system do gem listã¨ã rvm jruby-1.6.7 do ruby -vããã°ãã
yankã³ãã³ãã¯gemcutterã«å ¥ã£ã¦ãã®ã gem install gemcutter gem yank goldfish-poi -v 0.0.1 ååã¨ãã¼ã¸ã§ã³ãæå®ãã¦åé¤ãã
ï¼è§£æ±ºãããä¸ã«æ¸ããï¼ããå®è¡ãã㨠#!/usr/bin/env ruby require 'rubygems' require 'hashie' arr = Array.new 3.times do |i| arr.push Hashie::Mash.new(:count => i, :text => 'test'*i) end arr.each do |i| p i puts "count : #{i.count}" puts â¦
rvmã§ãæ°ããrubyã«ä¹ãæããæã«ãããããruby-1.8.7-p352 â 1.8.7-p358ã«ããã¨ããã rvm get latest rvm reload rvm list known rvm install 1.8.7-p358 gem listãä¿åãã¦ãã㦠gem list | ruby -lane 'puts $_.split(/\s/)[0]' > ~/gems.txt ããâ¦
herokuã§sinatraåãããã åèã«ãã http://devcenter.heroku.com/articles/quickstart http://devcenter.heroku.com/articles/ruby http://www.machu.jp/diary/20111002.html#p01 ãµã¤ã³ã¢ãã https://heroku.com ã§ãµã¤ã³ã¢ãããã¡ã¼ã«ãæ¥ãã®ã§confâ¦
capybara-webkitã§æ®å½±ãã縦é·ã®webãã¼ã¸ã¹ã¯ãªã¼ã³ã·ã§ãã(PNG)ãã1:1.41ã®A4縦é·ã§å°å·ã§ãããµã¤ãº(JPEG)ã«åå²ããã https://github.com/probablycorey/mini_magick brew install imagemagick gem install mini_magick mini_magickç #!/usr/bin/enâ¦
ä»ã¾ã§homebrewã§å ¥ãããpdfjamã使ã£ã¦ããã®ã ããmacportsã«ãããªãpdflatexã«ä¾åãã¦ããã®ã§ãã¾ã使ããããªãã prawn(https://github.com/prawnpdf/prawn)ã使ãã¨Rubyã ãã§ä½ããã®ã§ãä¹ãæãããã¨ã«ããã prawnã¯pngãå ¥ããã¨é ããªãã®â¦
capybara使ãã¨ç°¡åã«ãã£ããã£ã§ããããã¨ãã¨jsã®headless testã®çºã®ãã¼ã«ãªã®ã§jsãå®è¡ããããè¯ãã Macã®å ´å brew install qt gem install capybara capybara-webkit #!/usr/bin/env ruby require 'rubygems' require 'capybara-webkit' driver â¦