Skip to content

Instantly share code, notes, and snippets.

View schtibe's full-sized avatar

Stefan Heinemann schtibe

View GitHub Profile
@schtibe
schtibe / awesome_battery_widget.sh
Last active December 15, 2015 01:49
Awesome battery widget updater
#!/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'
@schtibe
schtibe / profile.sh
Last active December 13, 2015 16:49 — forked from ganwell/profile.sh
# 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"
@schtibe
schtibe / gist:1025518
Created June 14, 2011 18:27
MyTypeing in OOPLSS
class A {
def __construct(x: Int) {
self.x = x;
}
def m(): MyType {
return self;
}
def n(): MyType {
return self;
}
@schtibe
schtibe / Webdev Grep
Created June 25, 2015 08:59
Grep for Webdevs (filter all the minified stuff)
#!/bin/bash
grep --exclude=\"*min.js\" --exclude=\"*min.css\" --exclude=\"*map\" --color=always "$@"| awk '{ if (length($0) < 200) print }'