Sometimes we just want to display the website if all the images are loaded.
Or do something when a few images are loaded and viewable in the browser.
This script makes it very easy for you!
(continue reading…)
Sometimes we just want to display the website if all the images are loaded.
Or do something when a few images are loaded and viewable in the browser.
This script makes it very easy for you!
(continue reading…)
Scenario:
Sometimes u have an image tag in youre html file that is VERY big, and u want to read the height, width or something else in youre javascript.
You create a nice onload function that triggers when the dom is loaded.
You didnt set the width and height attribute in the image tag because u want it to be just as big as it is.
This specific prototype function tries to read the height: “$(‘someimage’).getHeight()” but what the f… :
height is 0, nothing or undefined????
(continue reading…)
Well.. kohana’s auth module is fine, but it does not work for me…
We programmers just want something we fully understand and most of the time we just write something ourselfs instead of using things that other programmers made.
That’s why i made my own auth module ( used lot of kohana’s auth module ), and i think that everyone could use this one..
The use is very simple, and the code is very easy to understand and extentable.
DOWNLOAD
includes:
-auth module
-sql script
The code works just fine… and when u take a look at the code you will see alot of different kind of databases handling. That is one of the learning curves here for you guys.
Take a look at the database (mysql workbench screenshot):
(continue reading…)
And again i searched the internet for some “easy” script to grab/download youtube movies to my own server.
I failed! So wrote my own.
Let me explain the steps or jump over to the VERY short working code:
First step we need to do 3 things:
*1: make a request to youtube for getting the required data
*2: make a second request to really get the .FLV file
*3: save the data to a file
*1: make a request to the url, in this case it is:
(just grabbed a url dont look at the content of it
)
(continue reading…)
*EDIT: check this post for an easy auth module i made myself
I searched the internet for a “GOOD” documentation about the auth module in kohana.
Couldnt find one… (not even on the official website….). [official documentation]
The example they include in the download of kohana isnt working at all (misses classes and so on….)
So i made an simple example.
Let’s start:
I assume that u have the auth tables allready correct inserted into youre database.
(if not go to modules/auth/views/auth/install.php query should be in the php source…)
Create a file login_test.php
place it in: application/controllers
CTR-C and CTRL-V the code in that file.
Goto: youredomain.nl/login_test
(continue reading…)
The title of this post says it all.
I made a MINI script timer object that counts how long a certain piece of code runs (executes).
It’s very handy for optimizing youre code!
The output is displayed in seconds with 3 digits behind the comma.
if you just want milliseconds remove the “/1000″ from:
this.scriptRunTime = (this.stopTime - this.startTime)/1000;
The code:
/**
* javascript script timer
* example:
* scriptTimer.startTimer();
* alert('hello');
* scriptTimer.stopTimer();
* alert(scriptTimer.scriptRunTime);
*
*/
var scriptTimer = {
scriptRunTime : 0,
startTime : 0,
stopTime : 0,
startTimer : function(){
time = new Date();
this.startTime = time.getTime();
},
stopTimer : function(){
time = new Date();
this.stopTime = time.getTime();
this.scriptRunTime = (this.stopTime - this.startTime)/1000;
}
}