1
2
3
4
//msg is the string to show in the alert.
//obj is the input to focus
function msgFocus(msg, obj){
...

JavaScript On Setting focus after alert

by Juha Hollanti, August 20, 2008 11:19

Form elements can be disabl...

A623216a5d2384489e012478c555d167 Talk

PHP On Getter and Setter

by Juha Hollanti, August 15, 2008 09:47

"Should you create a getter...

A623216a5d2384489e012478c555d167 Talk

PHP On Resize image to canvas

by Juha Hollanti, August 14, 2008 08:11

Checking for GD lib might a...

A623216a5d2384489e012478c555d167 Talk

PHP On Adding seconds to a MySQL t...

by Juha Hollanti, August 13, 2008 13:53

Wow, that's neat! And you'r...

A623216a5d2384489e012478c555d167 Talk
1
2
3
4
/**
 * Scale an image according to input canvas dimensions. 
 * No cropping will occur, the scaled image is "centered" to canvas.
...

PHP Resize image to canvas

by Juha Hollanti, August 13, 2008 11:50, 3 refactorings, tagged with php, image

The built in image function...

A623216a5d2384489e012478c555d167 Talk
1
2
3
4
echo '<qdapi>';
foreach($payload as $key => $value) {
    echo "<$key>$value</$key>";
...

PHP On Array and ForEach Loop

by Juha Hollanti, August 12, 2008 19:26

Yeah you're right, parsing ...

A623216a5d2384489e012478c555d167 Talk

ActionScript On Isometric X/Y Grid pattern ...

by Juha Hollanti, August 12, 2008 10:28

Umm, i don't know what you'...

A623216a5d2384489e012478c555d167 Talk

PHP On Adding seconds to a MySQL t...

by Juha Hollanti, July 15, 2008 19:42

Good stuff!

Gotta hate mys...

A623216a5d2384489e012478c555d167 Talk
1
2
3
4
/**
 * Split the supplied timestamp string, add the seconds and concatenate the whole thing back into timestamp format. 
 * Note! that the mktime function will perform even if the supplied amount of seconds exceeds 59. It just adds them 
...

PHP Adding seconds to a MySQL t...

by Juha Hollanti, July 14, 2008 13:38, 5 refactorings, tagged with php, mysql timestamp, conversion, add seconds

Suggestions are welcome. I'...

A623216a5d2384489e012478c555d167 Talk
1
2
3
4
public static function getColorFromString(color:String):int
{
    return parseInt(new RegExp(/[0-9a-fA-F]{6}/).exec(color),16);
...

ActionScript On Get color from string

by Juha Hollanti, July 13, 2008 21:04 Star_fullStar_fullStar_fullStar_fullStar_full

Ahh, ok. I misunderstood th...

A623216a5d2384489e012478c555d167 Talk
1
2
3
4
public static function getColorFromString(color:String):int
{
    // Convert '#' to '0x'. Everything starting with '0x' is interpreted by AS automatically as a hex number.
...

ActionScript On Get color from string

by Juha Hollanti, July 13, 2008 12:08

I can't picture getting aro...

A623216a5d2384489e012478c555d167 Talk