This file contains hidden or 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 | |
url=$(curl -F 'sprunge=<-' -H "Expect: " http://sprunge.us 2>/dev/null) | |
if [ $? -ne 0 ]; then | |
echo "request failed" >&2 | |
exit 1 | |
fi | |
if [ $# -gt 0 ]; then | |
url="$url?$1" | |
fi | |
echo $url |
This file contains hidden or 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 ruby | |
def usage(stdout = false) | |
stream = stdout ? $stdout : $stderr | |
bin = File.basename($0) | |
indent = " " * (bin.length() + "Usage: ".length()) | |
stream.puts("Usage: #{bin} [--help|-h]") | |
stream.puts(indent + " [--yes|--no|--maybe]") |
This file contains hidden or 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 | |
import mpd | |
HOST = "localhost" | |
PORT = 6600 | |
PASS = None | |
client = mpd.MPDClient() | |
client.connect(HOST, PORT) |
This file contains hidden or 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/sh | |
echo -n |
This file contains hidden or 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 | |
purple-remote getstatus &>/dev/null | |
if [ $? -ne 0 ]; then | |
exit 1 | |
fi | |
# get old status and message | |
if [ -f $HOME/.imstatus ]; then | |
previousstatus=$(head -n 1 $HOME/.imstatus) |
This file contains hidden or 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
# This has moved to https://github.com/tremby/imgur.sh |
This file contains hidden or 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 | |
if [ "$(purple-remote getstatus)" = "available" ]; then | |
setstatus=true | |
else | |
setstatus=false | |
fi | |
if $setstatus; then | |
echo "setting away" | |
im away |
This file contains hidden or 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 | |
np=$(mpc --format "%artist% -- \"%title%\" (##%track% on %album%)" | head -1) | |
if [[ $np == "volume:"* ]]; then | |
exit 1 | |
fi | |
echo "np: $np" |
This file contains hidden or 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 php | |
<?php | |
if (!isset($_SERVER["argv"][1])) { | |
fwrite(STDERR, "No keyword given\n"); | |
exit(1); | |
} | |
$xmlstring = @file_get_contents("http://php.net/" . urlencode($_SERVER["argv"][1])); | |
if ($xmlstring === false) { |
This file contains hidden or 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 ruby | |
def usage(stdout = false) | |
stream = stdout ? $stdout : $stderr | |
bin = File.basename($0) | |
indent = " " * (bin.length() + "Usage: ".length()) | |
stream.puts("Usage: #{bin} [--help|-h]") | |
stream.puts(indent + " [--vertical]") |
OlderNewer