Skip to content

Instantly share code, notes, and snippets.

@hellocatfood
hellocatfood / gist:5460556
Created April 25, 2013 15:22
Simple script to reorder sentences.
<html>
<head>
<title>Text Shuffler</title>
</head>
<body>
<h2>Shuffle your sentences</h2>
<?php
@hellocatfood
hellocatfood / gist:5489200
Last active December 16, 2015 19:59
Iteratively blur images in a directory
blur=0 bash -c 'for file in * ; do mogrify -blur 0x$blur $file; blur=$(expr $foo + 1) ; done'
@hellocatfood
hellocatfood / gist:5520178
Created May 5, 2013 08:45
Do batch conversions using GIMP via the command line. Replace file types on line 2 and 6
gimp -n -i -b - <<EOF
(let* ( (file's (cadr (file-glob "*.tiff" 1))) (filename "") (image 0) (layer 0) )
(while (pair? file's)
(set! image (car (gimp-file-load RUN-NONINTERACTIVE (car file's) (car file's))))
(set! layer (car (gimp-image-merge-visible-layers image CLIP-TO-IMAGE)))
(set! filename (string-append (substring (car file's) 0 (- (string-length (car file's)) 4)) ".xcf"))
(gimp-file-save RUN-NONINTERACTIVE image layer filename filename)
(gimp-image-delete image)
(set! file's (cdr file's))
)
@hellocatfood
hellocatfood / movie_cut.sh
Last active December 17, 2015 00:39
A script to perform a random cut on a video By Antonio Roberts | www.hellocatfood.com Usage: ./movie_cut.sh /path/to/avi/file Clip-duration-in-seconds e.g. ./movie_cut.sh 4.01 Works best on avi files requires avconv
#!/bin/bash
#A script to perform a random cut on a video
#By Antonio Roberts | www.hellocatfood.com
#Usage: ./movie_cut.sh /path/to/avi/file Clip-duration-in-seconds
#e.g. ./movie_cut.sh 4.01
#Works best on avi files
bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
length=`expr $(avprobe -loglevel error -show_streams $1 | grep duration | cut -f 2 -d = | head -1 | cut -d "." -f 1) \* 100`
#!/bin/sh -e
# Echobender
# By Antonio Roberts and Martin Meredith
# www.hellocatfood.com | www.sourceguru.net
# GNU/GPL
segons=`(date "+%Y%m%d%H%M%S")`
outfile="${segons}"
if [ ! -d ./echo ]; then
@hellocatfood
hellocatfood / feedback_loops.pd
Created April 2, 2014 14:05
Feedback loops in Pure Data. Now with masking!
#N canvas 1295 426 450 300 10;
#N canvas 957 82 929 997 feedback 0;
#X obj 360 250 cnv 15 220 180 empty empty empty 20 12 0 14 -228856
-262144 0;
#X obj 67 647 rotateXYZ;
#X obj 67 567 translateXYZ;
#X obj 364 275 grid grid1 100 0 10 100 0 10 0 0.1 0.1 10 10 236 82
;
#N canvas 65 118 450 300 translated 0;
#X obj 119 196 line;
#!/usr/bin/env python
import sys
import cv2
import subprocess
from subprocess import call
import aalib
import Image
#!/usr/bin/env ruby
# terrible word search generator
# inspired by http://cnlohr.blogspot.com/2014/02/to-make-terrible-wordsearches.html
if ARGV.length != 3
STDERR.puts "usage: #$0 WIDTH HEIGHT WORD"
exit 1
end
$word = ARGV[2].upcase
@hellocatfood
hellocatfood / sparkle.sh
Last active August 29, 2015 14:02
Tiles a gif and then overlays it over a static image.
#!/bin/bash
#tiles a gif and then overlays it over a static image. Only tested with jpgs and pngs on Ubuntu 14.04
#usage: ./sparkle.sh sparklegif.gif /directory/of/images/ (use the full location path)
sparklegif=$1
imagedirectory=$2
#create a large tile of the looping gif. It needs to be larger than the input static image, so "-scale" the $sparklegif if necessary or change the viewport value
@hellocatfood
hellocatfood / overlaytext.sh
Last active August 29, 2015 14:02
Overlay each line of a text file onto sequentially named image files
#!/bin/bash
#Developed for a very specific case. Your image files must be named 1.jpg, 2.jpg, 3.jpg etc. Place this script, the images files and the text file in the same folder. Then run ./overlaytext.sh. It'll overwrite the original files, so make a backup.
no=1
#change 40 to however many files you have
while [ $no -le 40 ]
#change textfile to whatever text file you have