<?xml version="1.0" encoding="UTF-8"?><!-- generator="WordPress/2.5" -->
<rss version="0.92">
<channel>
	<title>Emanuel Quintana</title>
	<link>http://emanuelq.com</link>
	<description>Freelance developer</description>
	<lastBuildDate>Fri, 18 Jul 2008 22:49:23 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>Total Blackjack</title>
		<description>Hi Guys!
I changed the math for the cards, after finished a Magic card game, I think to make a casino game. I enjoy when I play blackjack, so... I make it.
In this version, the tables rules are the next:

	Dealer stand on 17
	No late surrender
	No insurrance
	Surrender pay 1 to 2
	Blackjack pay ...</description>
		<link>http://emanuelq.com/2008/04/10/total-blackjack/</link>
			</item>
	<item>
		<title>Math Attack - The Memory Counter Strike</title>
		<description>Hi again!
This is second child of the family. I make a very simple interface, with no sound/music and no presentation. To play you need to find the couples between numbers and operations. The main goal of the game is clear all the pieces finding the valid operations. You have two ...</description>
		<link>http://emanuelq.com/2008/04/10/math-attack-the-memory-counter-strike/</link>
			</item>
	<item>
		<title>Math Attack - The Revenge of the numbers</title>
		<description>Hi guys!
This is my first flash game, the history is simple. One day I wake up with the idea to combine math with games, but in a easy way. The best option was Flash, the first steps was very hard, but always you have options, this time my option was ...</description>
		<link>http://emanuelq.com/2008/04/10/math-attack-the-revenge-of-the-numbers/</link>
			</item>
	<item>
		<title>Get the name of the file using substr</title>
		<description>Hi guys,
Here the php code to get the actual name of the file. This is very usefull when you need to get the name of the file and you only have the full path like /download/games/getfile.php. To get the name I use the $_SERVER["PHP_SELF"] var.
Here the code:

$file = substr(strrchr($_SERVER["PHP_SELF"],"/"),1);

If $_SERVER["PHP_SELF"] ...</description>
		<link>http://emanuelq.com/2007/12/10/10/</link>
			</item>
	<item>
		<title>How to get the extention of the file with php with strrchr function</title>
		<description>Hi guys,
With this code you can get the extension of a file. This is very simple and useful.

 
$ext = strrchr($file,".");

If the value of $file is "/files/games/mathattach.swf" the value of $ext will be ".swf";
 </description>
		<link>http://emanuelq.com/2007/11/10/how-to-get-the-extention-of-the-file-with-php-with-strrchr-function/</link>
			</item>
	<item>
		<title>How to make a permanent reditect with php headers</title>
		<description>Hi guys!
With this script you can make a permanent 302 redirection with php headers. This is very usefull when you want to make that google think that your domain.com is the same that www.domain.com.
Here the script:
if ($_SERVER["HTTP_HOST"] == "www.domain.com")
{
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://domain.com".$_SERVER["REQUEST_URI"]);
}
It's very simple, but very ...</description>
		<link>http://emanuelq.com/2007/11/10/11/</link>
			</item>
	<item>
		<title>Protect files from direct download</title>
		<description>Hi guys,
With this script you can control the access to your files with a ACL from secures referrers.
Here the code:
//Array with valid referers.
$validos = Array
(
"http://www.domain.com/files.php",
"http://www.domain.com/forum.php",
"http://www.domain.com/download/file.php"
};

//If is the referer in the array, we open the file
if (in_array($_SERVER["HTTP_REFERER"],$validos))
{
//Open the file
$file = $_SERVER["DOCUMENT_ROOT"]."/somefile.rar";
//Send the header with the content type of the file
header("Content-type: application/x-rar-compressed;");
//Send ...</description>
		<link>http://emanuelq.com/2007/06/16/9/</link>
			</item>
	<item>
		<title>How to compress a directory with tar</title>
		<description>Hi Guys,
If we need make a backup of a directory, the best options is use tar.
For example, you have a directory called /home/emanuelq/files and you would like to compress this directory,you can type tar command as follows:

tar -zcvf backup.tar.gz /home/emanuelq/files

The above command will create an archive called backup.tar.gz in the ...</description>
		<link>http://emanuelq.com/2007/02/21/how-to-compress-a-directory-with-tar/</link>
			</item>
	<item>
		<title>Function to convert an hexadecimal to rgb value</title>
		<description>Params:$hex: Hexadecimal value
Return:Array with the decimal value for red, gren and blue.
function hexToRgb($hex)
{
//Delete the # char (if exist)
if (0 === strpos($hex, '#')) {
$hex = substr($hex, 1);
} else if (0 === strpos($hex, '&H')) {
$hex = substr($hex, 2);
}
//get the 3 hex values
$cutpoint = ceil(strlen($hex) / 2)-1;
$rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), ...</description>
		<link>http://emanuelq.com/2007/02/16/7/</link>
			</item>
	<item>
		<title>Function to clear characters with php</title>
		<description>Params:$s: Original text.
Return:The text without the specials chars

 
function clearChars($s)
{
  //Array with the chars to remplace
  $remplazos = Array
  (
    "[áàâãª]" => "a",
    "[ÁÀÂÃ]"  => "A",
    "[ÍÌÎ]"   => "I",
    "[íìî]"   ...</description>
		<link>http://emanuelq.com/2006/10/05/8/</link>
			</item>
</channel>
</rss>
