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
#! /usr/bin/env python | |
# Standard library imports. | |
from SocketServer import ThreadingMixIn | |
import BaseHTTPServer | |
import SimpleHTTPServer | |
import sys | |
import json | |
import os | |
from os.path import (join, exists, dirname, abspath, isabs, sep, walk, splitext, |
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
#!/usr/bin/env bash | |
Appify="$(basename "$0")" | |
if [ ! "$1" -o "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF | |
Appify v5 for Mac OS X | |
Creates the simplest possible Mac OS X app from a shell script. | |
Takes a shell script as its first argument: |
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
import argparse | |
# Initialize argument parse object | |
parser = argparse.ArgumentParser(description="There are two flags, -f for fraud prevalence and -p to check prevalence in the output file") | |
# This would be an argument you could pass in from command line | |
parser.add_argument("-f", "--fraud", action="store", type = float, default = 0.2, help = "Enter the prevalence as a float, the default value is 0.2") | |
parser.add_argument("-p", "--prevalence", action="store_true", default = False, help = "use the flag to print the prevalence") | |
def main() : | |
inargs = parser.parse_args() |
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
#!/usr/bin/env bash | |
# Base16 - Gnome Terminal color scheme install script | |
[[ -z "$PROFILE_NAME" ]] && PROFILE_NAME="flatabulous-terminal" | |
[[ -z "$PROFILE_SLUG" ]] && PROFILE_SLUG="flatabulous-terminal" | |
[[ -z "$DCONF" ]] && DCONF=dconf | |
[[ -z "$UUIDGEN" ]] && UUIDGEN=uuidgen | |
dset() { | |
local key="$1"; shift |
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
#!/usr/bin/env bash | |
# Base16 - Gnome Terminal color scheme install script | |
[[ -z "$PROFILE_NAME" ]] && PROFILE_NAME="terminal.flat.theme" | |
[[ -z "$PROFILE_SLUG" ]] && PROFILE_SLUG="terminal-flat-theme" | |
[[ -z "$DCONF" ]] && DCONF=dconf | |
[[ -z "$UUIDGEN" ]] && UUIDGEN=uuidgen | |
dset() { | |
local key="$1"; shift |
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
#!/usr/bin/env sh | |
# | |
# Works best with blinking text: the last heart will blink when you have less | |
# than 25% of your battery life remaining. | |
# | |
# Add the following to your `~/.tmux.conf`; | |
# | |
# set -g status-right "#[fg=red]#(path/to/zelda-battery-tmux.sh) " | |
battery="$(pmset -g ps | awk 'NR==2' | perl -pe 's/.*?(\d+)%.*/\1/')" |
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
#!/usr/bin/zsh | |
# modified from http://ficate.com/blog/2012/10/15/battery-life-in-the-land-of-tmux/ | |
HEART='x' | |
if [[ `uname` == 'Linux' ]]; then | |
current_charge=$(upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage | awk '{print $2}' | sed 's/%//g') | |
total_charge=100 | |
else | |
battery_info=`ioreg -rc AppleSmartBattery` |
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
#!/usr/bin/env sh | |
gconftool-2 -s -t string /apps/gnome-terminal/profiles/Default/palette "#000000000000:#919122222626:#777789890000:#AEAE7B7B0000:#1D1D25259494:#68682a2a9b9b:#2B2B66665151:#929295959393:#666666666666:#CCCC66666666:#B5B5BDBD6868:#F0F0C6C67474:#8181A2A2BEBE:#B2B29494BBBB:#8A8ABEBEB7B7:#ECECEBEBECEC" | |
gconftool-2 -s -t string /apps/gnome-terminal/profiles/Default/background_color "#1d1d1f1f2121" | |
gconftool-2 -s -t string /apps/gnome-terminal/profiles/Default/foreground_color "#c5c5c8c8c6c6" | |
gconftool-2 -s -t string /apps/gnome-terminal/profiles/Default/bold_color "#8A8ABEBEB7B7" | |
gconftool-2 -s -t bool /apps/gnome-terminal/profiles/Default/bold_color_same_as_fg "false" | |
gconftool-2 -s -t bool /apps/gnome-terminal/profiles/Default/use_theme_colors "false" | |
gconftool-2 -s -t bool /apps/gnome-terminal/profiles/Default/use_theme_background "false" |