Skip to content

Instantly share code, notes, and snippets.

@pix0r
pix0r / split-3200x1200-image.sh
Created January 29, 2010 19:41
split a 3200x1200 image into left and right parts
#!/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"
@pix0r
pix0r / shared_followers.rb
Created February 23, 2010 19:52 — forked from damon/shared_followers.rb
find shared twitter followers, then print all usernames
#!/usr/bin/env ruby
# Author: Damon Clinkscales
# Modified 2010-02-23 by Mike Matz
# Loop through all shared follower IDs to expose usernames.
# Not recommended for people with a lot of followers!
require 'rubygems'
require 'hpricot'
require 'net/http'
function get_csv_line($fp) {
$sep = '|';
$quote = '"';
$escape = "\\";
$fields = array();
$field = '';
$in_field = true;
$in_quoted_field = false;
$in_escape = false;
#!/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
#!/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
<?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'];
<?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
*/
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
/**
* 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');