— clmpr

clmpr (clumper) is an open-source multi-user bookmarking engine, inspired by the original del.icio.us (RIP)

demo: clmpr.com source: http://github.com/quilime/clmpr

more...

— show hidden files (OSX Finder)

via Terminal

show hidden files:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

hide hidden files:

defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder

more...

— Combine Files (Windows)

copy /b file1+ file2 output

eg

copy /b picture.jpg + archive.rar file.jpg

Open file.jpg with the default application, it will show the picture “picture.jpg”. Change the extension to “file.rar” or if you try to open “file.jpg” with an archiver you will get the contents of “archive.rar”.

more...

— create ssh keys

ssh-keygen -t rsa

# linux
ssh-copy-id [user@]host

# macos
cat ~/.ssh/id_rsa.pub | ssh user@machine "mkdir -p ~/.ssh; cat >> ~/.ssh/authorized_keys"
eval `ssh-agent`
ssh-add

more...

— resize multiple images

for k in $(ls *.JPG); do convert $k -resize 50% -quality 80 r_$k; done

more...

— URL Rewrite Double Slashes to Single

RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]

more...

— date for new filename

#!/bin/bash
# Shell script to create file named after the current date
# YYYY-MM-DD format

DATE=$(date +%Y"-"%m"-"%d)
echo -e "new file" > $DATE

more...

— Rename Multiple Files via Shell

ls | nl -nrz -w2 | while read a b; do mv "$b" filename.$a.png; done;

more...

— Sphere Intersect in Maya/MEL

Function to return location of intersect with poly mesh and spherical object moving in the positive direction on the Y axis.

more...

— Image Slice

Shell script that slices a single image into any number of vertical and horizontal sections. Using ImageMagik convert

#!/bin/bash

IMAGE=$1
IMAGE_W=$2
IMAGE_H=$3
ROWS=$4
COLS=$5

if [ $# -eq 0 ]
then
	echo "usage: image width height rows cols"
	echo "example: ./slice.sh Sunset.jpg 800 600 16 16"
	exit
else

	for (( x = 1; x <= COLS; x++ ))
	do
	    for (( y = 1 ; y <= ROWS; y++ ))
	    do
	    	let CROP_X = `expr $IMAGE_W-IMAGE_W/$x`
	    	let CROP_Y = `expr $IMAGE_H-IMAGE_H/$y`
	    	let CROP_W = `expr $IMAGE_W/$ROWS`
	    	let CROP_H = `expr $IMAGE_H/$COLS`
	        echo -n "crop ${CROP_W}x${CROP_H}+${CROP_X}+${CROP_Y} result: [${x},${y}]_$IMAGE"
	        echo ""
			convert $IMAGE -crop ${CROP_W}x${CROP_H}+${CROP_X}+${CROP_Y} [${x},${y}]_$IMAGE
	    done
	done

fi

more...