ä½æãããé åãªãã¸ã§ã¯ãããããã·ã¥ãªãã¸ã§ã¯ããä½æãããã¨ãã§ãã¾ããç¹å¥ãªã¡ã½ãããç¨æããã¦ããããã§ã¯ãªãã®ã§ãå¥ã®ç¨éã®ã¡ã½ãããçµã¿åããããã¨ã§é åããããã·ã¥ãä½æãã¾ããããã§ã¯ Ruby ã§é åããããã·ã¥ãä½æããæé ã«ã¤ãã¦è§£èª¬ãã¾ãã
ããªã¤ã«ã®ç¼å£²ã¨ä¸è¯çã ããªã¤ã«ããããè¦ãããããã«ãªãã¾ããããçãç°ã§ãæ³³ãã§ãããã®ãä¸æ¯è³¼å ¥ãã¾ãã ç«æ´¾ãªå¤§ããªå¢¨è¢ãèã¯å·åä¿åã㦠æãããªèº«ã¯å£ç¯ã®ãè±ããéèã¨åããã¦ä¸è¯ã®çããã®ã«ãæ°é®®ãªã«ãã«ãã®èã¯å»ã¿ãé¦ãé«ãé£æ¬²ããããã¾ãã ä¸è¶³ã¯ãã³ãã«ãâ¦
ããã«ã¡ã¯ djangoæ´¾é¥ã¨railsæ´¾é¥ã®äºããæ¿ããæè¿ã®ã¦ãã¦ã§ããã¡ãªã¿ã«è¥å¹²railsãåªå¢ã§ãã require 'openssl' def encrypt(aaa, solt = 'solt') enc = OpenSSL::Cipher::Cipher.new('aes256') enc.encrypt enc.pkcs5_keyivgen(solt) ((enc.update(aaa) + enc.final).unpack("H*")).to_s rescue false end def decrypt(bbb, solt = 'solt') dec = OpenSSL::Cipher::Cipher.new('aes256') dec.decrypt dec.pkcs5_keyivgen(solt) (dec.update(Array.new([bbb]).pa
ããªãã ãããããããã®ã§ä»åº¦èª¿ã¹ãã¨æ¸ããã¨ããã«ã¤ãã¦ã CSRFã®å¯¾å¿ã«ã¤ãã¦ãrails使ããç¥ã£ã¦ããã¹ãã㨠- ããããWEBãµã¼ãã¹éçºæ¥è¨ ã¾ãã¯ããã¼ã¨ã»ãã·ã§ã³ã®éããããèªåã®èªèã¯ãããªæã ã¯ããã¼ãã»ãã·ã§ã³ãããã©ã¦ã¶ã«ãã¼ã¿ãä¿åãããä»çµã¿ã ã¯ããã¼ã¯ãã¼ã¿ããã®ã¾ã¾ãã©ã¦ã¶ã«ä¿åãããã ã»ãã·ã§ã³ã¯ã»ãã·ã§ã³IDããã©ã¦ã¶ã«ä¿åããããã¼ã¿ã¯ãµã¼ãå´ãä¿æããããµã¼ãã¯ã»ãã·ã§ã³IDããã¼ã«ãã¦ãã¼ã¿ãåãåºãã railsã§ã¯ããã¼ãè¨å®ããã«ã¯ railsã§ã¯ãã¯ããã¼ã¯åºæ¬çã«ä½¿ããªãã¨æã£ã¦ã¾ãããä¸å¿ä½¿ãæ¹ãã¡ã¢ã cookies[:hoge] = { :value => "value", :expires => "30.days.from_now", :path => "/store", :domain => "www.example.
Rubyã§ä½¿ããããã·ã¥é¢æ°ã®æ§è½ã測ã£ã¦ã¿ãã Rubyã®ã¡ãã»ã¼ã¸ãã¤ã¸ã§ã¹ãã©ã¤ãã©ãªã§ä½¿ããããã·ã¥é¢æ°+String#hashã®å¦çæéãè¨æ¸¬ åå¦çã10000åå®è¡ãã¦åè¨å¦çæéãåºãã çµæã¯ä»¥ä¸ã ããã·ã¥é¢æ° æè¦æé(ç§) sha1 0.913 sha256 1.572 sha384 3.039 sha512 3.024 md5 0.86 rmd160 1.1 hash 0.797 (ä½ãå®è¡ããªã:æ¯è¼ç¨) 0.692 sha2ç³»ã¯ãã¯ãéãã sha1,md5,hashã¯ã»ã¼åãã§é«éã è¨æ¸¬ç°å¢ã¯ä»¥ä¸ã CPU : Intel Core 2 Duo 2.19GHz ã¡ã¢ãª : 1.99 GB è¨æ¸¬ã«ä½¿ç¨ããã¹ã¯ãªããã¯æ¬¡ã®éãã require 'digest/sha1' require 'digest/sha2' require 'digest/md5' r
2009å¹´06æ12æ¥02:30 ã«ãã´ãªLightweight LanguagesBlogosphere perl - ç¾ä»£ç㪠Perl ãåç¿å¾ããæ¹æ³ã¯ TopHatenarã§perlä¸ä½ã®ç§ãæ¥ã¾ãããã ç¾ä»£ç㪠Perl ãåç¿å¾ããæ¹æ³ã¯ï¼ - ã¹ã©ãã·ã¥ãããã»ã¸ã£ãã³ ç¾ä»£ç㪠Perl ãç¿å¾ããããã«ã¯ãã©ã®ãããªã¹ããããè¸ãã®ãè¯ãã ããã ? ã¾ããå§ãã®æ¸ç±ãªã©ãã£ããæãã¦æ¬²ããã ã¢ãã³Perlã«éãããããã°ã©ãã³ã°ãå?ç¿å¾ããã®ã«æé©ãªæ¹æ³ãããã¯.... ããã°ã«æ¸ãã¤ã¥ããã㨠ã§ããä»ã®ã©ããªææ³ãããã«åããã¨ã¯ãªãã¨å¼¾è¨ãã¾ãããã 以ä¸ããã®ä¸ã¤ã®çç±ã 1. èªç¶ã«ã¢ã¦ãããããåºæ¥ã ããã°ã©ã ã¯ãè¨èªã§æ¸ãã¾ãã æ¸ããã®ã§ãã以ä¸ãæ¸ããªããã°è¦ãããã¾ããã ãããããã½ã¼ã¹ã³ã¼ããèªãã§ããæ¸ããªããã°èªåã®ãã®ã«ã¯ãªãã¾ã
ã©ããDSLãæ°æã¡æªãã¦ããã¹ã³ãã»ã³ã dependencyã«RubyInlineã®3.6.3ãããã®ã§ãæ®éã«gemããã¨ã¨ã©ã¼ãèµ·ãã¾ãã % sudo gem install scrubyt % sudo gem install RubyInline --version '= 3.6.3' % sudo gem uninstall RubyInline --version '=3.6.5' ãªããééã£ã¦ãæ°ããããã©æ°ã«ããå°ããªã³ã¼ããæ¸ãã¦ã¿ããtumblrã®followings url listã #!/opt/local/bin/ruby -Ku require 'rubygems' require 'scrubyt' require 'yaml' login = YAML.load_file('login.yaml') data = Scrubyt::
ActiveSupport ã«ãã Date, Time ã¯ã©ã¹ã®æ¡å¼µã¾ã¨ãããã¼ã¸ã§ã³ã¯ 2.0.2 æºæ ãã½ã¼ã¹ãèªã㧠script/console ã§åä½ç¢ºèªãè¡ã£ã¦ãã¾ãã ç¸äºç½®æ Date ã§ã Time ã§ãããããã to_time ããã³ to_date ã§ç¸äºã«ç½®æã§ãã¾ãã å¿ è¦ã§ããã° to_datetime 㧠DateTime åã¸ã®å¤æãå¯è½ã§ãã to_s ã®æ¡å¼µ to_s ã«å¼æ°ãã¤ããäºã§ãæå®ã®å½¢å¼ã§åºåãã¦ããã¾ãã Time.now.to_s(:db) => "2008-2-23 17:49:29" å¼æ°ã¨åºåã®å¯¾å¿ã¯ä»¥ä¸ã®ã¨ããã Time å¼æ°åºå :db%Y-%m-%d %H:%M:%S :time%H:%M :short%d %b %H:%M :long%B %d, %Y %H:%M :long_ordinallambda { |time
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}