Inspired by http://dribbble.com/shots/975425-Flat-UI-login
A Pen by Marco Biedermann on CodePen.
Ctrl + A Go to the beginning of the line you are currently typing on | |
Ctrl + E Go to the end of the line you are currently typing on | |
Ctrl + L Clears the Screen, similar to the clear command | |
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line. | |
Ctrl + H Same as backspace | |
Ctrl + R Let’s you search through previously used commands | |
Ctrl + C Kill whatever you are running | |
Ctrl + D Exit the current shell | |
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it. | |
Ctrl + W Delete the word before the cursor |
v = 'foobar' | |
if v =~ /^foo(bar)$/ | |
puts $1 # => "bar" | |
end |
grep "help" *.html |
class Numeric | |
def duration | |
secs = self.to_int | |
mins = secs / 60 | |
hours = mins / 60 | |
days = hours / 24 | |
if days > 0 | |
"#{days} days and #{hours % 24} hours" | |
elsif hours > 0 |
du -sh ./*/ | |
# could probably also | |
du -sh ./*/ | sort -n |
Inspired by http://dribbble.com/shots/975425-Flat-UI-login
A Pen by Marco Biedermann on CodePen.
Inspired by http://dribbble.com/shots/911891-Login
A Pen by Secret Sam on CodePen.
# git today | |
git config --global alias.today '!git log --since=midnight --author="$(git config user.name)" --oneline' | |
# git yesterday | |
git config --global alias.yesterday '!git log --graph --all --since="day.before.yesterday.midnight" --until=midnight --author="$(git config user.name)" --oneline' |
# tested on Ruby 1.9.3 | |
CSV.parse(response.body, { :headers => true, header_converters: :symbol, converters: :all }).collect { |row| Hash[row.collect { |c,r| [c,r] }] } |
#Example syntax for Secure Copy (scp)
##What is Secure Copy?
scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.
###Examples
Copy the file "foobar.txt" from a remote host to the local host