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 | |
if [ -z "$1" ] | |
then | |
mkdir -p ~/.vim/autoload ~/.vim/bundle && curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim | |
if [ ! -d ~/.vim/bundle/nerdtree ]; then | |
git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree | |
fi |
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 | |
echo "Hello, footpad!" | |
me=`basename "$0"` | |
socket_path=~/"${me}".socket | |
if [ -z "$1" ] || [ "$1" == "open" ] | |
then | |
if [ -f "${socket_path}" ] |
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
SELECT @row := @row + 1 as i FROM | |
(select 0 union all select 1 union all select 3 union all select 4 union all select 5 union all select 6 union all select 6 union all select 7 union all select 8 union all select 9) t, | |
(select 0 union all select 1 union all select 3 union all select 4 union all select 5 union all select 6 union all select 6 union all select 7 union all select 8 union all select 9) t2, | |
(select 0 union all select 1 union all select 3 union all select 4 union all select 5 union all select 6 union all select 6 union all select 7 union all select 8 union all select 9) t3, | |
(select 0 union all select 1 union all select 3 union all select 4 union all select 5 union all select 6 union all select 6 union all select 7 union all select 8 union all select 9) t4, | |
(SELECT @row:=0) t5; |
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 | |
current_capacity=$(ioreg -l | grep -o '"CurrentCapacity" = [0-9]*' | awk '{print $3}') | |
max_capacity=$(ioreg -l | grep -o '"MaxCapacity" = [0-9]*' | awk '{print $3}') | |
design_capacity=$(ioreg -l | grep -o '"DesignCapacity" = [0-9]*' | awk '{print $3}') | |
if [[ -n "$current_capacity" && -n "$max_capacity" && "$max_capacity" -ne 0 && -n "$design_capacity" && "$design_capacity" -ne 0 ]] | |
then | |
percentage=$(echo "scale=2; ($current_capacity / $max_capacity) * 100" | bc) | |
echo "Battery charge: $percentage%" |