Skip to content

Instantly share code, notes, and snippets.

@davidcelis
davidcelis / zelda-battery.sh
Created December 18, 2012 00:28
Output a Zelda-style heart meter for your MacBook's battery level. On the command line. Based on an idea from @stephencelis, executed by myself. For a tmux version, see https://gist.github.com/4324139
#!/usr/bin/env zsh
#
# Works best with blinking text; the last heart will blink
# when you have less than 25% of your battery life remaining.
BATTERY="$(pmset -g ps | awk 'NR==2' | perl -pe 's/.*?(\d+)%.*/\1/')"
if [[ $BATTERY -lt 25 ]]; then
echo "\e[5;31m♥\e[0;31m♡♡\e[0m"
elif [[ $BATTERY -lt 50 ]]; then
@dalmaer
dalmaer / WhyRunAnOpenSourceProgram.md
Last active February 6, 2022 20:28
Some thoughts on why a company should consider running an open source program.

Why run an open source program?

Why would a company spend resources on an open source program, and why is it really needed?

These are great questions, and my point of view has probably changed in some ways over time. I have been involved in open source since the start of my engineering career, participating with great open source foundations such as Apache, and then seeing a prototypical example when I got to join Chris DiBona’s open source program office at Google. This is truly learning from the master. Not only is Chris on the list of “I would work for that guy again in a heart beat!” but he was fantastic at providing the frameworks that allowed engineers to get the most out of open source, while also helping the business.

Back then, the tooling and pervasiveness of open source wasn’t quite where it is today, hence Google Code and other solutions coming out of the open source group.

Let’s fast forward to today.