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
Earthquake.alias_command ':r', ':retweet' | |
Earthquake.alias_command ':f', ':favorite' | |
Earthquake.alias_command ':re', ':recent' | |
Earthquake.alias_command ':m', ':mentions' | |
Earthquake.alias_command ':o', ':open' | |
Earthquake.alias_command ':br', ':browse' | |
Earthquake.alias_command ':del', ':delete' | |
Earthquake.alias_command ':rm', ':delete' |
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
Earthquake.init do | |
command :fr do |m| | |
target = twitter.status(m[1]) | |
if confirm("fav & RT '@#{target["user"]["screen_name"]}: #{target["text"]}'") | |
async_e { | |
twitter.retweet(m[1]) | |
twitter.favorite(m[1]) | |
} | |
end | |
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
git log -1 --oneline | cut -b 9- |
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
<root> | |
<tag1>body1</tag1> | |
<tag2> | |
<tag21>body21</tag21> | |
<tag22>body22</tag22> | |
</tag2> | |
</root> |
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
(let [[a1 a2 _] (let [x (xml-seq (clojure.xml/parse (clojure.java.io/input-stream (java.net.URI. "https://gist.github.com/kaosf/6205132/raw/17a803a4cd7e816698fde5b30552a77272a2b507/sample.xml"))))] (clojure.data/diff x (seq x)))] (and (nil? a1) (nil? a2))) |
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
(do | |
(require 'clojure.xml 'clojure.data) | |
(let | |
[[a1 a2 _] | |
(let | |
[x | |
(xml-seq | |
(clojure.xml/parse | |
(clojure.java.io/input-stream | |
(java.net.URI. "https://gist.github.com/kaosf/6205132/raw/17a803a4cd7e816698fde5b30552a77272a2b507/sample.xml"))))] |
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
(do | |
(require 'clojure.xml 'clojure.data) | |
(let | |
[x | |
(xml-seq | |
(clojure.xml/parse | |
(clojure.java.io/input-stream | |
(java.net.URI. "https://gist.github.com/kaosf/6205132/raw/17a803a4cd7e816698fde5b30552a77272a2b507/sample.xml"))))] | |
(= x (seq x)))) |
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
(do | |
(require 'clojure.xml 'clojure.data) | |
(let | |
[x | |
(->> (java.net.URI. "https://gist.github.com/kaosf/6205132/raw/17a803a4cd7e816698fde5b30552a77272a2b507/sample.xml") clojure.java.io/input-stream clojure.xml/parse xml-seq)] | |
(= x (seq x)))) |
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
class HashTagsManager | |
def filepath | |
"#{ENV['HOME']}/.earthquake/autohash" | |
end | |
def save(hashtags) | |
File.open filepath, 'w' do |f| | |
f.puts hashtags | |
end | |
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/sh | |
[ 1 = $(curl $1.herokuapp.com 2> /dev/null | grep "<h1><strong>Heroku | No such app</strong></h1>" | wc -l) ] |