Skip to content

Instantly share code, notes, and snippets.

View retr0h's full-sized avatar
💭
(✖╭╮✖)

נυαη נυαηѕση retr0h

💭
(✖╭╮✖)
  • Los Angeles, CA
  • 06:41 (UTC -12:00)
View GitHub Profile
@mlafeldt
mlafeldt / parse_yaml.py
Created October 13, 2011 15:44
[Python] Parse and pretty-print YAML
#!/usr/bin/env python
import sys
import yaml
import pprint
filename = sys.argv[1]
y = yaml.safe_load(open(filename, 'r'))
require 'nokogiri'
doc = Nokogiri.XML DATA
class Hasify
def convert node
return node.text if node.text?
{ node.name => node.children.map { |x| convert x } }
end