nerijuso.lt
nerijuso.lt
nerijuso.lt
Mar 28th
Some it is necessary to disable backspace button in browser. This javascript code can help to disable backspace:
document.onkeydown = function () {
var e = event || window.event;
var keyASCII = parseInt(e.keyCode, 10);
var src = e.srcElement;
var tag = src.tagName.toUpperCase();
if(keyASCII == 13) {
return false;
}
if(keyASCII == {
if(src.readOnly || src.disabled || (tag != "INPUT" && tag != "TEXTAREA")) {
return false;
}
if(src.type) {
var type = ("" + src.type).toUpperCase();
return type != "CHECKBOX" && type != "RADIO" && type != "BUTTON";
}
}
return true;
}
Jan 31st
The goal of a reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on.
The reset styles given here are intentionally very generic. There isn’t any default color or background set for the body element, for example. I don’t particularly recommend that you just use this in its unaltered state in your own projects. It should be tweaked, edited, extended, and otherwise tuned to match your specific reset baseline. Fill in your preferred colors for the page, links, and so on.
In other words, this is a starting point, More >
Jan 31st
Some said that you cannot centre floated elements but this is not quite true. It’s true that usually you can only float left or float right but if you have a group of buttons (for example it is menu) and you want them to be fluid in width then it would be nice to have them all float in the centre of the page. There is no problem if the floats have a width because you can then ascertain the main parents width and use margin:auto to center the whole block. However that means that the floats cannot be a More >
Oct 25th
At grub-boot loader screen select Recovery mode the version of the kernel that you wish to boot and type e for edit. Select the line that starts with kernel and type e to edit the line.
Go to the end of the line and type init=/bin/bash as a separate one word (press the spacebar and then type init=/bin/bash). Press enter key to exit edit mode.
Back at the GRUB screen, type b to boot into single user mode. This causes the system to boot the kernel and run /bin/bash instead of its standard init. This will allow us gain root privileges (w/o More >
Jun 9th
Yesterday I had a task make stream images from ip camera. IP camera always put images to the same directory with same image name. This is a source code, whick can do this.
var tick=0;
image=new Image();
reload = new Date();
reload = reload.getTime();
image.src="http://your_domain.lt/camera/image.jpg?nocache="+reload;
function refreshCam()
{
tick++;
if(tick>3){restart=1;} else {restart=0;}
if(image.complete)
{
tick=0;
document.images["webcam"].src = image.src;
image=new Image();
reload = new Date();
reload = reload.getTime();
window.status = "";
image.src="http://your_domain.lt/camera/image.jpg?nocache="+reload;
}
if(restart)
{
tick=0;
image=new Image();
reload = new Date();
reload = reload.getTime();
window.status = "";
image.src="http://your_domain.lt/camera/image.jpg?nocache="+reload;
}
window.status = window.status + ".";
setTimeout("refreshCam()", 1000);
}
refreshCam();
And this is html More >
Jun 5th
var class= window.location.href.slice(window.location.href.indexOf('#') + 1).split('#');
if(class){
jQuery('.testimonial_cont').find('.'+class).show('slow');
jQuery('html,body').animate({scrollTop: jQuery('.testimonial_cont').find('.'+class).parent().offset().top},'slow');
}
Of course you can change slow to normal or fast or even a int in milliseconds.
I hope it will help for someone.
May 24th
Some days ago I have a problem with my server and all my innodb tables were locked. And now I want to tell, how I tried to repair these tables.
First of all, I tried to do force recovery. In mysql config file enable force recovery. Set innodb_force_recovery = 1 and try to do mysqldump. If it not work, try to increase innodb_force_recovery value to 6. Default innodb_force_recovery value is 0. After you change innodb_force_recovery value, restart mysql.
But this method did not help me. Other method is simulate InnoDB tables. You will need .ibd file and the CREATE TABLE statement for each More >
Mar 31st
With WordPress, you have the ability to create a network of sites (Multisite). This article is instructions for creating a network (multiple sites).
/* That's all, stop editing! Happy blogging. */:
<define('WP_ALLOW_MULTISITE', true);
This allow to use multiple sites in your wordpress.
Mar 12th
To add class to wordpress wysiwyg editor copy this php code to your theme function.php file
if ( ! function_exists('tdav_css') ) {
function tdav_css($wp) {
$wp .= ',' .get_bloginfo('stylesheet_directory') . '/style_css.css';
return $wp;
}
}
add_filter( 'mce_css', 'tdav_css' );
Here you add new style file. In this file create your new css classes. Now go to wysiwyg editor and there you will see your created classes. Use them for table or links.