MySQL Birthday Column – Age of a Person July 8th, 2009
If you search for a solution to get the age of a person (in years) in MySQL, google gives you many obsolete (and complicated) answers, from MySQL 4.1.1 it is very easy to get this number:
TIMESTAMPDIFF(YEAR, myDateColumn, NOW())
Have fun.
DIV layer with 100% height, the Javascript way July 1st, 2009
When you create a div layer with 100% width and height, the height is always only the height of the browser window, not of the page content (which can be much higher).
To solve this, give the layer div an id and use the following JS code inside the layer div:
<script type="text/javascript">document.getElementById("yourlayerid").style.height = document.getElementsByTagName("body")[0].offsetHeight + "px";</script>
The code is very simple, it gets the height of the content (the body element) and gives it the layer div.
Tested in Opera, Firefox and *barf* MSIE (8).
Posted in Programming | 4 Comments »
How to force file downloading with htaccess July 1st, 2009
Nearly every browser will show image oder video files you want to provide for download in the browser itself instead of opening a download dialog.
Most of the websites suggest to use this code in your .htaccess:
<FilesMatch "\.(jpg|zip|avi)$" > ForceType application/octet-stream </FilesMatch>
But this is not enough! Even when the MIME-Type is set to “octet-stream”, some browsers will still open the files their selfs because they have detected the .jpg or .avi file extension.
The solution to this is to add the following header:
<FilesMatch "\.(jpg|zip|avi)$" > ForceType application/octet-stream Header add Content-Disposition "attachment" </FilesMatch>
With this header every browser i tested opened a download dialog, regardless of which file extension is present.
On-the-fly Picture Swapping, how to get it work in MSIE June 5th, 2009
To swap or reload a picture on the fly is easy with Javascript. Just give the img tag a unique id and execute the following command in javascript:
document.getElementById("picture").src = "/img/cool-picture.jpg";
Now comes the glitch in (guess where) Internet Explorer: If you want to reload a picture that has changed on the server (let’s say you have overwritten the picture with a php gd-lib script in the background), the Internet Explorer (i call him msie, spoken “emsy”) always keeps the cached picture instead of reloading the picture from the server like opera and firefox do.
You can fix this behaviour with a simple cache-avoiding technique: Add a random number as a parameter, as shown in the following code, that’s it.
document.getElementById("picture").src = "/img/cool-picture.jpg?r=" + Math.floor(Math.random() * 1000);
Posted in Programming | No Comments »
TimeWaster’s Banking Script for CS:S Eventscripts February 7th, 2009
TimeWaster’s Banking Script is an advanced bank based on Eventscripts v1.5 and a SQLite database which makes it incredibly fast.
There’s an converter included to convert and copy “EternalBank” bank accounts for your easy switching pleasure.
Posted in Plugins, Programming | 23 Comments »
TimeWaster’s Happy Hour Script for CS:S Eventscripts December 28th, 2008
TimeWaster’s Happy Hour Script v1.0 for Counter Strike Source
This script will give every player weapons and equipment for free at the period you define.
Posted in Plugins, Programming | 6 Comments »
YAST (Yet Another Standard Theme) WordPress theme September 27th, 2008
Bugfix Release v1.1 is available! For more info’s take a look at the end of this article.
YAST (Yet Another Standard Theme) is a good looking kubrik compliant theme for WordPress.
You are looking at it RIGHT NOW!
It is not only good looking, the additional features are really nice:
TimeWasters CS:S Configurator September 27th, 2008
TimeWaster’s CS:S Configurator is a online Counter Strike:Source config generator.
It’s main goal is not to provide you with buy scripts or stuff like this, it’s goal is to give you the ability to crunch your WHOLE CS:S config including the following settings:
- Nickname
- Mouse sensitivity
- Sound Volume
- Crosshair color and size
- Auto weapon switch
- Common bindings
- Your personal Counter Strike MENU
- And many more
in one ZIP file.
This means if you have a freshly installed CS:S and you want to apply your settings, you only have to unzip ONE FILE, set your screen resolution, and all your config work is done!!! no need to define a spraylogo, no need to add “-console” to your start options… all is done by unzipping that one file.
So don’t hesitate and create your config now!
Posted in Programming, Tools | No Comments »
Bookmarks Plugin for Roundcube September 27th, 2008
This is a simple Bookmarks “Plugin” for Roundcube. With it, you can administrate all your bookmarks (or favorites) within the web-mailer surface.
ClickForYou September 27th, 2008
ClickForYou is a nifty little tool i wrote to be able to cheat in the game Insaniquarium, a game made by the PopCap guys.
How does it work?
That’s Easy: After you ran the executable and pressed the “Pause” button on your keyboard, it emulates a left click on your mouse every 20 milliseconds. This means you are clicking the left button on your mouse 50 times a second without moving your finger. To stop clicking, simply press your “Pause” key again.
