This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'pry' | |
| require 'rack' | |
| require 'thin' | |
| class TestingServer | |
| def self.start | |
| builder = Rack::Builder.new { run Rack::Directory.new('') } | |
| Rack::Handler::Thin.run builder, :port => 3000 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| bashorg=$(curl -s http://bash.org/?random1|grep -oE "<p class=\"quote\">.*</p>.*</p>"|grep -oE "<p class=\"qt.*?</p>"|sed -e 's/<\/p>/\n/g' -e 's/<p class=\"qt\">//g' -e 's/<p class=\"qt\">//g'|perl -ne 'use HTML::Entities;print decode_entities($_),"\n"'|head -1) | |
| files=($(cowsay -l|sed 's#Cow files in /usr/share/cowsay/cows:##')) | |
| num_files=${#files[@]} | |
| cowsay -f "${files[$((RANDOM%num_files))]}" ${bashorg} | |
| unset bashorg files num_files |
NewerOlder