✄codebook

a cut&paste code archive

Dreamweaver CS3 Crashes and Unable to Start Again - a simple fix

31/01/10 05:44 PM

Credits

  1. Mike Padgett for his lifesaving article that saved me hours of googling.
  2. David Powers for the original solution!!!

Scenario

dreamweaver suddenly crashes while you are editing a file… may be a html file or css file. no biggie, but relaunching the program doesn’t work. neither does restarting your computer work. O NOES!!! do you have to uninstall dreamweaver again??? (even if you do, it doesn’t work either???) what’s going on? why do The Powers That Be bestow this upon you while you are rushing a deadline!?!?

Solution

apparently, dreamweaver crashes when you save a file to exactly 8,192 bytes or a multiple of it. seriously? why not let’s try.

step1

try to remember the last file you worked on, or if you can’t remember, at least you remember the site you were working on? check the files, if theres anything that’s 8bytes, open it in Properties. does the exact bytesize come up to 8,192 bytes? yes?

you are in luck! this may solve your problem!

step2

open that evil file in notepad or some other text editor. now add the filesize by adding some extra spaces or something.

step3

save the file.
check its Properties again; the filesize should NOT be 8,192bytes, nor a multiple of that evil number.

step4

try to launch dreamweaver. it should launch!!! now all is good!!!!!!!! your life is saved!!!! deadlines can be met!!!!! the pounding in your heart is slowing!!!!

now go and finish your coding!

Tags: Tips&Tricks

Comment


Wordpress: Modify Default Image Name Suffix

05/12/09 11:41 AM

Credits

  1. exbionic for asking this question in the wordpress support forums
  2. fltseng and jstnryan for coming up with this hack!

Scenario

you want to change wordpress’s lame filenaming convention of images processed through their uploader into the media library.

basically you want your files, instead of being named:
IMAGE-150x150 and IMAGE-300x300 and IMAGE-1024x1024
you want it named:
IMAGE-thumb and IMAGE-medium and IMAGE-large

Solution

step1

in the directory where you store your wordpress core files, open .

step2

for wordpress 2.8 only… ??

go to line 358

for other versions: do a search for )

you should find this bit of code that looks like this:

step3

replace that chunk of code with:

tadaa!!!

do note that because this is a HACK, everytime you upgrade your wordpress version you have to redo this step. its unavoidable, until wordpress gets their act together and realizes how stupid this naming convention is, or until someone comes up with a plugin to fix this.

Tags: Hacks PHP

Comment


Dynamic External Link Section Embedding for your Blog! (or site...)

26/02/09 02:08 PM

Credits

  1. del.icio.us for their useful and innovative service!
  2. del.icio.us’s helpful Link Rolls feature.

Scenario

You use del.icio.us bookmarks religiously (like me)

You have a blog (or site) which has a links section that you update pretty often because you keep finding new people to link!

You want the links section of your blog/site to correspond to a certain group of bookmarks on your del.icio.us so that:

  • everytime you see a blog/site that you want to link, you can simply add it to your del.icio.us with the specific tag that will make it show up on your blog sidebar / site links list
  • you don’t need to go into editing your blog template / site html to update your links!

Solution

step1

Organise your del.icio.us bookmarks to add a special tag for the sites you want to link. e.g. append a new tag bloglinks to all the links you want to appear on your blog sidebar.

step2

Go to del.icio.us’s Link Rolls page page and at the bottom you should see settings for you to customise your widget.

Under the field Tags (optional), type in bloglinks or whatever special tag you appended in step 1.

You may also add a title, choose the sorting… etc.

When you are done, you should have a piece of code looking somewhat like this:
<script type="text/javascript" src="http://feeds.delicious.com/v2/js/XXXXX/ bloglinks ?title=MyBlogLinks&count=100&sort=alpha"></script>

where XXXXX is your del.icio.us username.

This code will display all your bookmarks tagged with bloglinks.

To specify additional tag filters, do not rely on typing in things like blog+fashion+link into the Tags (optional) field in del.icio.us’s link rolls page. Because the +’s will be converted to %2B in the generated javascript code, like this:
http://feeds.../js/XXXXX/blog %2B fashion %2B link
which will break your code when you actually want it to be:
http://feeds.../js/XXXXX/blog + fashion + link
so, to specify 2 or more tags, please edit the javascript code manually.

step3

Copy and paste the code given to you by del.icio.us link rolls into the portion of your blog/site template and publish.

Taa-daa! Now all bookmarks tagged bloglinks will appear on your sidebar! Let me know if you have found this useful!

Tags: JavaScript Tips&Tricks

Comment


CSS3: hiphiphooray for new features!

15/01/09 04:14 PM

Credits

List of the New Features

Dropshadow divs with CSS3.

this effect:

the CSS3 code:

in the format of:
box-shadow: [displacement X] [displacement Y] [blur width] [color];

to force this to work on Safari & Firefox3+ include these lines:

Dropshadow text with CSS3.

this effect:

the CSS3 code:

in the format of:
text-shadow: [dX] [dY] [blur] [color];

This only works on Safari and browsers which support CSS3 properties.

Rounded corner borders with CSS3123.

this effect:

the CSS3 code:

in the format of:
border-radius: [radius size];

to force this to work on Safari & Firefox3+ include these lines:

also, it is possible to specify a different border-radius for each corner like this:

the CSS3 code:

to force this to work on Safari & Firefox3+ include these lines:

Custom border image with CSS3123.

this effect:

the CSS3 code:

nb. you must specify the border (with a width that would accomodate your repeating border image size) otherwise border-image would not work.

in the format of:
border-image: url([image]) [border width] [behaviorX] [behaviorY];
where [behaviorX] and [behaviorY] can be stretch, round, or repeat.

to force this to work on Safari & Firefox3+ include these lines:

also, it is possible to vary the behavior of your border-image (by using one image only) for each corner like this:

the CSS3 code:

to force this to work on Safari & Firefox3+ include these lines:

Color & transparency by RGBA with CSS3.

this effect:

the CSS3 code:

in the format of:
_PROPERTY_ : rgba([red value], [green value], [blue value], [opacity])

This property works on Safari and Firefox 3.0+.

Opacity by opacity value with CSS3.

this effect:

the CSS3 code:

in the format of:
opacity: [decimal degree of opacity];

This property works on Safari and Firefox 3.0+.

Custom fonts by embedding with CSS3.

this effect:

the CSS3 code:

in the format of:
font-face { font-family: "[assign a name to the font]"; src: url([font file location]) format("opentype"); }

This only works on Safari and browsers which support CSS3 properties1.
Please only use free fonts2 for application of this property to avoid legal issues.

1 Firefox 3.1+ apparently renders CSS3 properties as well.

2 Here is a useful page on the free fonts available for @font-face embedding.

View Demo

Tags:

Comment [1]


Dropdown Select Menu for URL Links

13/01/09 01:06 PM

Credits

  1. the original creator of this script is unknown, however, if it happens to be you, please contact me and i’ll credit you rightaway.

Scenario

Create a dropdown menu that, when an option is selected, will launch a new window that opens up the specified link.

Solution

step1

Insert this code into <head> and </head> of your html document:

step2

and this is the code that you put in your <body>.

change the URLs and linking names to your own. add more lines if needed.
text within <option selected> and </option> is the line that will be displayed/first selected when the page is loaded.

view the demo here.

that’s it! tadah!

Tags: JavaScript

Comment


« Older