forked from robmiller/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_functions
49 lines (41 loc) · 1005 Bytes
/
bash_functions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
function console () {
if [[ $# > 0 ]]; then
query=$(echo "$*"|tr -s ' ' '|')
tail -f /var/log/system.log|grep -i --color=auto -E "$query"
else
tail -f /var/log/system.log
fi
}
function kill_port() {
if [[ $# > 0 ]]; then
lsof -P | grep ':'$1 | awk '{print $2}' | xargs kill -9
fi
}
function ips() {
ifconfig | grep "inte " | awk '{ print $2 }'
}
function scratch() {
if [ -f ~/Dropbox/Elements/Scratchpad.txt ]; then
vim ~/Dropbox/Elements/Scratchpad.txt
fi
}
function spaces_to_tabs() {
sed -i '' -E "s/ / /g" **/*(.)
}
function strip_trailing_whitespace() {
sed -i '' -E "s/[[:space:]]*$//" **/*(.)
}
function delete_font() {
if [[ $# > 0 ]]; then
rm ../webfonts/$1.ttf;
rm ../webfonts/$1.eot;
rm ../webfonts/$1.woff;
fi
}
# Compile Compass, making a guess about what directory to compile in.
function compile_compass() {
ls -d1 **/.sass-cache/../ | xargs -L1 compass compile --force -s compressed
}
function show_sites() {
cat ~/bin/prox/etc/sites.json
}