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
#!/bin/bash | |
while true ; do | |
state=`acpi -b` | |
percentage=`echo $state | grep -oP '\d+(?=%)'` | |
color='green' | |
echo $state | grep 'Discharging' && [[ $percentage -lt 15 ]] && color='red' | |
echo $state | grep 'Discharging' && [[ $percentage -gt 15 ]] && color='yellow' |
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
# 5000 unique bash history lines that are shared between | |
# sessions on every command. Happy ctrl-r!! | |
shopt -s histappend | |
# Well the python code only does 5000 lines | |
export HISTSIZE=10000 | |
export HISTFILESIZE=10000 | |
export PROMPT_COMMAND="history -a; unique_history.py; history -r; $PROMPT_COMMAND" |
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
class A { | |
def __construct(x: Int) { | |
self.x = x; | |
} | |
def m(): MyType { | |
return self; | |
} | |
def n(): MyType { | |
return self; | |
} |
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
#!/bin/bash | |
grep --exclude=\"*min.js\" --exclude=\"*min.css\" --exclude=\"*map\" --color=always "$@"| awk '{ if (length($0) < 200) print }' |
NewerOlder