Home

Get sshkey finger print

Since recently github got a security issue, we need to update the sshkey, then require you to check the finger print, below is the code to get finger print.

$ ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub

Standard clearfix

.clearfix {
  zoom: 1;
}

.clearfix:after {
  content: '';
  clear: both;
  display: table;
}

All selector of css3

*

E

.class

#id

E F

E > F

E + F

E[attribute]

E[attribute=value]

E[attribute~=value]

E[attribute|=value]

:first-child

:lang()

:before

::before

:after

::after


:first-letter

::first-letter

:first-line

::first-line

E[attribute^=value]

E[attribute$=value]

E[attribute*=value]

E ~ F

:root

:last-child

Ruby regexp detect CJK character

#encoding: UTF-8
class String
  def contains_cjk?
    !!(self =~ /\p{Han}|\p{Katakana}|\p{Hiragana}|\p{Hangul}/)
  end
end

strings= ['中国国際放送局', '광고 프로그램', '真是牛阿', 'This is english.']
strings.each{|s| puts s.contains_cjk?}

Result will be:

true true true false


How to add default encoding to all files in project?

This is a very helpful tool to add “# -- encoding : utf-8 --“ to all .rb file.

  • https://github.com/m-ryan/magic_encoding