Skip to content

Instantly share code, notes, and snippets.

@kunst1080
Last active January 1, 2016 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunst1080/8112907 to your computer and use it in GitHub Desktop.
Save kunst1080/8112907 to your computer and use it in GitHub Desktop.
1liner in Christmas
# create "Christmas"
echo 4368726973746d6173 | gsed 's/./&\n/g' | xargs -n 2 | gsed 's/^/:/g' | xargs | tr -d ' ' | nkf --cap-inpu
# V2
echo `echo '3^5*37*43*113'|bc``echo '2*3^2*17*241'|bc`d6173|gsed 's/./&\n/g'|xargs -n 2|sed 's/^/:/g'|xargs|tr -d ' '|nkf --cap-input
# tree
jot 10 1 10|awk '{print "paste -d . <(yes \" \"|head -"11-$1"|tr -d \"\\n\") <(yes \"#\"|head -"$1*2-1"|tr -d \"\\n\")"}'|bash
# tree on ruby (http://www.reddit.com/r/programming/comments/er5ym/ruby_code_drawing_a_christmas_tree_in_less_than/)
ruby -e "((1..20).to_a+[6]*4).each{|i|puts ('#'*i*2).center(80)};puts;puts 'Merry Christmas'.center(80)"
# add star
ruby -e "puts ' '+'☆'.center(80);((1..20).to_a+[6]*4).each{|i|puts ('#'*i*2).center(80)};puts;puts 'Merry Christmas'.center(80)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment