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/php | |
<?php | |
$totranslate = file_get_contents('php://stdin'); | |
if (strlen($totranslate) > 1500) { | |
file_put_contents("php://stderr", "Truncating text to 1500 characters"); | |
$totranslate = substr($totranslate, 0, 1500); | |
} |
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
<?php | |
/** | |
To use, place desc_to_cont_rss.php somewhere within your webroot. Then point your browser to http://localhost/desc_to_cont_rss.php?rss=http://example.com/feed.rss | |
Adjust the paths appropriately for your setup. You may need to urlescape the path to the feed, e.g. http%3A%2F%2Fexample.com%2Ffeed.rss | |
*/ | |
$rss = $_GET['rss']; | |
if (empty($rss)) { | |
$http = "400 Bad Request"; |
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
<?php | |
/** | |
* Plugin Name: Media Categories and Tags | |
* Plugin URI: https://gist.github.com/goodevilgenius/755bc2e7b78ee0b26890 | |
* Description: Adds categories to media | |
* Version: 0.3.0 | |
* Author: Dan Jones | |
* Author URI: http://danielrayjones.com/ | |
* License: MIT | |
*/ |
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
#!/bin/bash | |
# Gist: 11375877 | |
# Url: https://gist.github.com/goodevilgenius/11375877 | |
# | |
# All memcache functions are supported. | |
# | |
# Can also be sourced from other scripts, e.g. | |
# source membash.sh | |
# MCSERVER="localhost" |
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
<?php | |
/** | |
* @version 0.1 | |
*/ | |
/* | |
Plugin Name: Atom:Updated | |
Plugin URI: https://gist.github.com/goodevilgenius/9786001 | |
Description: This plugin adds atom:updated to your RSS2 feed | |
Author: Dan Jones | |
Version: 0.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
<?php | |
$url = $_GET['url']; | |
if (!preg_match('@http://(www\.)?reddit\.com/r/([A-Za-z0-9]+)\.rss@', $url)) { | |
header("HTTP/1.0 400 Invalid Reddit RSS URL"); | |
exit; | |
} |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:. `,:;;;;;;;;;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;` ``;;;;;;;;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::,` `,::;;;;;;;;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:``:;;;;;;;;;;;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;..;;;;;;;;;;;;; | |
;;;;;;;;.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,;;;;;;;;;;;;; | |
;;;;;;;;.;;;;;;; |
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
#!/bin/sh | |
while [ "$#" -ne 0 ]; do | |
EXT="${1##*.}" | |
FILENAME=`basename "$1" .${EXT}` | |
TMP=`mktemp` | |
ffmpeg -i "$1" -s 320x240 -vcodec xvid -an "${TMP}.avi" | |
ffmpeg -i "$1" -vn "${TMP}.wav" |
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
#!/bin/sh | |
function GetNext() { | |
CURR=$(wmctrl -d | grep '^[[:digit:]]*[[:blank:]]*\*' | sed 's/^\([[:digit:]]*\).*/\1/') | |
LAST=$(wmctrl -d | tail -1 | sed 's/^\([[:digit:]]*\).*/\1/') | |
TOTAL=$(expr $LAST + 1) | |
NEXT=$(expr $(expr $CURR + 1) % $TOTAL) | |
echo $NEXT | |
} |
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
#!/bin/bash | |
# Now included in https://github.com/goodevilgenius/fortune-drj/ | |
DIR="${HOME}/.fortune/files" | |
FILE="quotes-$(date +%Y-%m)" | |
quote=`mktemp` | |
[ ! -d "$DIR" ] && mkdir -p "$DIR" |