Jun 30
icon1 admin | icon2 technical | icon4 06 30th, 2009| icon3 No Comments »

for some reason there are lot of tutorials coming out of the UK. this is just one of them. good read on OO javascript.

nefariousdesigns.co.uk

Your Ad Here
Jun 27
icon1 admin | icon2 technical | icon4 06 27th, 2009| icon3 No Comments »

so in a previous post i put up a how to do on renaming files in a for loop and string replacing. here is another example for taking files and renaming them all with lovely counts as well.

here is the line of code. that we will execute.

james@lappy2000:~/ count=1; for i in *.mp3; do mv "$i" "myband_${count}.mp3"; : $((count=count+1)); done

lets break it down for more details.
first off here is the count, we shall start with 1, you can start with any number you wish.

count=1;

your for loop, niotice we are putting the count in ${count}, now you can do this, or $count. either way is correct.

do mv  for i in *.mp3; do mv "$i" "myband_${count}.mp3";

you now see this. the colon basically says im a new command in this “do” section. and the double parens basically mean treat the insides like a variable.

: $((count=count+1));

thats basically it.

Jun 17
icon1 admin | icon2 technical | icon4 06 17th, 2009| icon3 No Comments »

this is my jquery-ui dialog resizer.
ever have a dialog box that you wanted to re-size dynamically?
for instance, you have a form and w/in the form you have some additional items that are hidden and only want them to display if the user selects a certain parameter. well you can hide the items, and then when you want to show it, have the dialog magically re-size to accomodate

you can grab the code over at google docs.
http://code.google.com/p/jquerydialogresize/

if you have any questions on use. point your comments to the google groups.

I’ll have a demonstration here soon.

Your Ad Here
Jun 14
icon1 admin | icon2 technical | icon4 06 14th, 2009| icon3 No Comments »

jargonmonkey.com phase one is complete.

you can now now add any url at the end, and our jargon monkey will gladly take it over.

example.

http://jargonmonkey.com/http://www.flowerpoop.com

have fun!

Jun 8
icon1 admin | icon2 technical | icon4 06 8th, 2009| icon3 No Comments »

let say you have many files in a directory, and you need to rename them all at once. you can go the route and do each one by one. but man that takes way too long. why not a bash script? with bash you can easily rename all your files quickly at once.

first off go into the directory you want to do this in and choose the file extensions, let say we are doing this with images this will list all the *.jpg images in your directory

lanqy@lappy2000:~/$  for i in *.jpg; do echo $i; done

you can also list this way it does the exact same thing.

lanqy@lappy2000:~/$  for i in *.jpg; do echo ${i}; done

let say you want to rename a particular portion w/in the jpg image.
the wild cards can be places strategically.

lanqy@lappy2000:~/$ for i in *_blah_*.jpg; do echo $i; done

now that you have this, and you want to remove the “_blah”, test the waters with the “echo” command before the “mv” command

lanqy@lappy2000:~/$ for i in *_blah*.jpg; do echo mv "$i" "${i/_blah}"  ; done

the command below is the how you do a simple string replace

lanqy@lappy2000:~/$ do echo mv "$i" "${i/_blah}"

you are basically saying w/in $i, look for _blah and remove. if you put another slash afterwards it means replace with _meh

do echo mv "$i" "${i/_blah/_meh}"

thats all! have fun replacing files, oh yeah remove the echo when you want to execute it completely.

Your Ad Here
Older Poop
Newer Poop
Get Adobe Flash playerPlugin by wpburn.com wordpress themes