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
# seen on https://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know/answer/Jostein-Austvik-Jacobsen?__snids__=1567875257&__nsrc__=4 | |
# usage currency_convert 14.99 eur usd | |
# output 14.9900 EUR = 16.7019 USD | |
currency_convert() { | |
wget -qO- "http://finance.google.com/finance/converter?a=$1&from=$2&to=$3" | sed '/res/!d;s/<[^>]*>//g'; | |
} |
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 | |
gpg --list-sigs --keyring ~/.gnupg/pubring.gpg | sig2dot > ~/.gnupg/pubring.dot | |
neato -Tpng ~/.gnupg/pubring.dot > ~/.gnupg/pubring.png |
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 Parent | |
include Mongoid::Document | |
field :something, :type => String | |
has_many :children | |
after_create :create_child | |
private | |
def create_child | |
children.create | |
end |