Skip to content

Instantly share code, notes, and snippets.

View keccers's full-sized avatar

Katherine Champagne keccers

View GitHub Profile
@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
@dtbaker
dtbaker / dtbaker.wiki-mode.php
Created April 4, 2013 15:41
hacking WordPress to support nested custom post types.
<?php
// get_page_by_path called in query.php 2119 !
//remove_action('template_redirect', 'redirect_canonical');
@jonathanhculver
jonathanhculver / Default.sublime-theme
Created July 13, 2013 21:36
Dark theme (twilight) for sublime text folder sidebar. Click Browse Packages and add file named "Default.sublime-theme" to Packages/User
[
{
"class": "sidebar_container",
// right border
"layer0.tint": [84,84,84],
"layer0.opacity": 1.0,
"layer0.draw_center": false,
"layer0.inner_margin": [0, 0, 1, 0],
"content_margin": [0, 0, 1, 0]
},