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
# Format Guidelines for Commit and Issue Notes # | |
## Commit Message ## | |
Summary on the first line of **what** you did ([fixes|adds] #00) | |
Give a brief description of **why** you made your changes. Be sure to include the link to the issue on the summary line. The goal is to be able to read this message later and know what it was regarding and more importantly to justify your decisions to change the code. | |
## Issue Notes ## |
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
Regex to match parts of a domain | |
http://stackoverflow.com/questions/4636497/regular-expression-match-domain-in-uri | |
^[^\/]+:\/\/[^\/]*?\.?([^\/.]+)\.[^\/.]+(?::\d+)?\/ | |
http://www.rubular.com/r/Uv5ON7eAz4 | |
^ # Match the beginning of the string | |
[^\/]+:\/\/ # Match the protocol (e.g. http://) | |
[^\/]*? # Non-greedy match of the sub-domains | |
\.? # Optional . (for when a sub-domain is used) |
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
mysqldump -h host -u username -ppasswd database_name table_name > export_file_name.sql |
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
:! <cmd> # executes a command | |
:! wc % # % means this file | |
:! sudo ./% # executes the script you're editing | |
:%s/^\n$//gc # remove whitespace from within vim |
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
# translate case | |
tr '[:upper:]' '[:lower:]' < input.txt > output.txt |
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
# Regular expression | |
&[^;]*; # find HTML entities | |
<[^>]*> # select HTML tags <div> |
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
# Split Select Pages from Multiple PDFs into a New Document | |
pdftk A=one.pdf B=two.pdf cat A1-7 B1-5 A8 output combined.pdf |
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
# Use ctrl + d to exit write mode when using cat | |
cat > file.txt # overwrites | |
cat >> file.txt # appends | |
echo "Text to write in file" > file.txt | |
echo "Text to write in file" >> file.txt | |
echo -e "line one\nline two\n\tindented text" > file.txt |
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
# Using a list with the mv command | |
mv README.{txt,textile} | |
mv config{,.old} | |
mv foo{,bar} | |
mv {,~}foo | |
mv {~,}foo |
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
# Create an iso from a mac | |
hdiutil makehybrid -iso -o Microsoft-Office-2011.iso /Volumes/Microsoft\ Office\ 2011/ |