This file contains hidden or 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 | |
# install first the engine from http://mike.verdone.ca/twitter/ | |
tweets="tweets.txt" | |
sleeptime=5 | |
while read line;do | |
t update "$line" && sleep $sleeptime | |
done <$tweets |
This file contains hidden or 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 | |
SAVEIFS=$IFS | |
IFS=$(echo -en "\n\b") | |
i=0 | |
for dir in $(ls -d *); do | |
# cd to book directory | |
my_dirname="${dir%%}" | |
mydir=(cd "./$my_dirname") | |
${mydir[@]} |
This file contains hidden or 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
/\-$/,/[^\-]$/{ | |
:a | |
N | |
/\-$/ ba | |
s/\-\n+//g | |
} |
This file contains hidden or 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 | |
tempdf=$(tempfile) | |
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=$2 -dLastPage=$3 -sOutputFile=$tempdf $1 | |
gs -dNOPAUSE -sDEVICE=png16m -r600 -dDownScaleFactor=3 -dBATCH -dSAFER -sOutputFile="$4-$2-%00d.png" $tempdf | |
rm -f $tempdf |
This file contains hidden or 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 | |
# insert text lines after first line and before last line of file | |
# $1 = a glob expression like */assets/*.css | |
# $2 = a literal to be inserted after first line | |
# $3 = same as above but inserted before last line | |
for f in $1; do | |
eval "sed -ri '1 s/(.*)/\1\n$2; $ s/(.*)/$3\n\1/' \"$f\"" | |
done |
This file contains hidden or 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 | |
# path where reside images for OCR | |
path=$1 | |
filename='' | |
ocrized='' | |
home=$(pwd) | |
# cd $path |
This file contains hidden or 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 | |
files=$1 | |
for file in $files; do | |
# first delete all empty, succesive lines | |
# then add an extra newline | |
sed -i -r ':a;/^$/{d;ba};x;s/^.+$/\n/g;p;x' "$file" | |
done |
This file contains hidden or 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 | |
# $1 = path to directory where docx files are stored | |
dir="$1" | |
for dox in $1/*.docx; do | |
# filename with spaces replaced with underscores | |
doc="${dox// /_}" | |
# path without extension | |
noext=${doc%.*} |
This file contains hidden or 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
trait StaticFactory | |
{ | |
public static function Make() | |
{ | |
$args = \func_get_args(); | |
$class = new \ReflectionClass(get_called_class()); | |
$instance = $class->newInstanceArgs($args); | |
return $instance; |
This file contains hidden or 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
for file in $(ls *.jpg -t | head -n 11); do convert $file -resize 50% $file; done |
OlderNewer