Skip to content

Instantly share code, notes, and snippets.

View phaibin's full-sized avatar
🎯
Focusing

Leon phaibin

🎯
Focusing
View GitHub Profile
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@phaibin
phaibin / xml_checker.rb
Created March 2, 2013 00:24
check xml tag error
# encoding: utf-8
def find_tag(str)
if str =~ /<\/(.*?)>/mu
return {is_begin: false, tag: $~.captures.first}
end
if str =~ /<(.*?)( |>)/mu
return {is_begin: true, tag: $~.captures.first}
end
end