pimteam

pimteam

Joined
Feb 07, 2012
Location
Svoge, Bulgaria
About me
прасето с Роршаховата риза

Activity Stream

pimteam created a Page  -  May 14, 2014
180 

Sometimes you need to do preg_replace on user input. Don't forget to escape all special characters or you'll get funny results. Here is how:

 Respond   PHP  
pimteam created a Page  -  Mar 13, 2013
1 227 

A class to convert km/h to mph and knots and vice-versa. It can also parse speeds in a text and return the text with corrected and converted speeds. See the live demo at http://ultralight-airplanes.info/yspeed.html for better idea what can it do.

pimteam commented on a Page, RoCanvas  -  Nov 28, 2012

Thanks for the feedback guys. Yeah, I know what you mean now, Proicons. At this moment I have no solution to any of these. This is raster drawing, so you can't move objects as vectors. Maybe in some future version, if ever.

 Respond  
pimteam commented on a Page, RoCanvas  -  Nov 27, 2012

Proicons, I can't reproduce the erase problem. Are you sure you have not clicked on "Clear canvas" button? Traces are known issue, can't solve it at the moment.

Hawkee, thanks. Sure, here's the demo URL: http://re.trotoys.com/rocanvas/rocanvas.html

There are two boards on that page with the JS code shown.

 Respond  
pimteam created a Page  -  Nov 27, 2012
4 140 

This is a javascript class that converts the HTML 5 Canvas element into interactive drawing board with tools etc. The code below contains the full class, but I recommend downloading the zip from http://re.trotoys.com/article/rocanvas/ because it contains CSS, images and samples. The code is Apache licensed so you can use it on your sites without any issues.

pimteam commented on a Page, Convert Height and Weight  -  Oct 08, 2012

Thanks mate :) I don't remember how I found this site but I like it. Good work!

 Respond  
pimteam commented on a Page, Convert Height and Weight  -  Oct 08, 2012

You mean the front page of calendarscripts? yeah, most wrote myself.

 Respond  
pimteam commented on a Page, Convert Height and Weight  -  Oct 08, 2012

Thanks. Yeah, all code is mine there as well.
Sunslayer, thanks for the suggestion, 5/11 is indeed much better.

 Respond  
pimteam created a Page  -  Oct 08, 2012

This is rather simple stuff yet I see it so rarely used. In any dating sites, health calculators, DIY stuff calculators etc they ask you to enter weight and height of something (or your own weight and height) only in their preferred measurement system (metric or Imperial). Boring! This simple javascript will convert the units and instantly fill the appropriate fields in the form.

pimteam commented on a Page, Calendar Class  -  Aug 21, 2012

Interesting, I'll try it, thanks!

 Respond  
pimteam commented on a Page, CompCalc  -  Aug 16, 2012

Thanks folks!

 Respond  
pimteam commented on a Page, Calendar Class  -  Aug 16, 2012

Below is how the class can be used to make a HTML table with a calendar:

<?php
$_calendar = new Calendar();
$num_weeks=$_calendar->num_weeks(8, 2012); // August 2012
?>

MonTueWedThuFriSatSun
<?=$day?$day:" "?>

That's it. Obviously you can dynamically load month and year to show a dynamic calendar. I use this code in one of my scripts, just not ready to release the full script yet, that's why posting the snippet. The snippet is universal and can be used for any kind of calendar. I will be super-happy if someone can suggest good way to add configurable options for first day of the week etc.

 Respond  
pimteam created a Page  -  Aug 16, 2012

I have struggled with creating calendars in PHP and HTML several times so far. There are different approaches, but I believe the class below is one of the best possible in terms of code readability.

  3 Threads   PHP  
pimteam commented on a Page, CompCalc  -  Jul 13, 2012

Sorry for the late reply (there was no email about getting a comment). Yeah, code is mine.

 Respond  
pimteam created a Page  -  Feb 07, 2012
1 552 

This class calculates compounded interest on investment, saving or loan. It allows variable compounding (reinvesting) percentage. Here's a page where you can see the class used: http://sharkinvestor.com/investment-calculator/

  5 Threads   PHP  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.