Last active
August 29, 2015 14:02
-
-
Save melborne/31f81cc17084a0aea7d7 to your computer and use it in GitHub Desktop.
This file contains 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
# flip plugin | |
# ==== | |
# | |
# You can post flip text or vertical text. | |
# | |
# Usage | |
# ---- | |
# | |
# :flip twitter # => "ɹəʇʇᴉʍʇ" | |
# | |
# :flip -r twitter # => "ʇʍᴉʇʇəɹ" | |
# | |
# :flip -v FOO\\BAR++ by vertical # => "B F" | |
# "A O" | |
# "R O by vertical" | |
# | |
# See also: | |
# ---- | |
# | |
# * https://github.com/melborne/flippy | |
require 'flippy' | |
Earthquake.init do | |
command /^:flip\s+\-(r|v)\s+(.+)$/, :as => :flip do |m| | |
subcommand, text = m.captures | |
case subcommand | |
when 'r' | |
status = text.flip.flip | |
when 'v' | |
status = text.gsub(/\\\\/, "\n") | |
.gsub(/ +/, "\n") | |
.vertical | |
end | |
async_e {twitter.update(status)} if confirm(status) | |
end | |
command :flip do |m| | |
status = m[1].flip | |
async_e {twitter.update(status)} if confirm(status) | |
end | |
end | |
# https://gist.github.com/melborne/31f81cc17084a0aea7d7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment