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 | |
IMAGE=$1 | |
EXT=`echo $IMAGE | sed -e 's/.*\(\.[A-Za-z0-9]*\)$/\1/'` | |
BASE=`echo $IMAGE | sed -e 's/^\(.*\)\(\.[A-Za-z0-9]*\)$/\1/'` | |
LEFT_IMAGE="$BASE-left$EXT" | |
RIGHT_IMAGE="$BASE-right$EXT" | |
if [ "$IMAGE" = "" ]; then | |
echo "Usage: $0 image.jpg" |
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
function get_csv_line($fp) { | |
$sep = '|'; | |
$quote = '"'; | |
$escape = "\\"; | |
$fields = array(); | |
$field = ''; | |
$in_field = true; | |
$in_quoted_field = false; | |
$in_escape = false; |
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 | |
// taken from http://code.google.com/p/auto-link-rewriter-php/ | |
function auto_link_text($text) { | |
$pattern = '#\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))#'; | |
return preg_replace_callback($pattern, 'auto_link_text_callback', $text); | |
} | |
function auto_link_text_callback($matches) { |
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 | |
# Installation: Make svn-growlnotify.sh executable (chmod +x svn-growlnotify.sh) and | |
# add an entry to your crontab similar to: | |
# * * * * * /path/to/svn-growlnotify.sh -s https://your.repository.url/ 1>/dev/null 2>&1 | |
# | |
# Usage: svn-growlnotify.sh -s <SVN_ROOT> [-l LOG_URL] [-r REV_FILE] [-m MAX_REVS] [-g GROWLNOTIFY] | |
# | |
# Default settings |
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 | |
# | |
# svn-revs-tortoise-to-cmdline.sh | |
# | |
# converts merges from TortoiseSVN-type format to individual svn merge commands. | |
# mergefile should contain a newline-delimited list of the revision list that TortoiseSVN | |
# outputs. Eg: "1,3,6-8,11,15" should be "1\n3\n6-8\n11\n15" | |
trunk=http://my.repo/trunk | |
mergefile=merges.txt |
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 | |
define('REPOSITORY_PATH', "/path/to/svn/repo"); | |
// Note: You'll need to set this part up yourself :) | |
define('NOTIFY_URL', 'http://site.com/notify.php?rev=%rev%&author=%author%&msg=%msg%'); | |
define('PATH_IDEAL_LEN', 30); | |
define('PATH_MAX_LEN', 50); | |
$argv = $_SERVER['argv']; | |
$argc = $_SERVER['argc']; |
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 defined('SYSPATH') or die('No direct script access.'); | |
//-- Environment setup -------------------------------------------------------- | |
/** | |
* Set the default time zone. | |
* | |
* @see http://docs.kohanaphp.com/about.configuration | |
* @see http://php.net/timezones | |
*/ |
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
tell application "System Preferences" | |
activate | |
set current pane to pane "com.apple.preference.displays" | |
end tell | |
tell application "System Events" to tell window 1 of process "System Preferences" | |
try | |
tell tab group 1 to click radio button "Arrangement" | |
on error | |
return "Only one display available." | |
end try |
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
/** | |
* Added to override the default parse_str(php://input) | |
*/ | |
if (!empty($_SERVER['REQUEST_METHOD']) | |
&& in_array($_SERVER['REQUEST_METHOD'], array('GET', 'POST')) === false | |
&& empty($_POST)) { | |
// Store original request | |
$input = file_get_contents('php://input'); |
OlderNewer