$a=0;
$b=1;
$c=0;
echo ("$a\n");
echo ("$b\n");
for ($i=0;$i<=17;$i++){
$c=$a+$b;
$a=$b;$b=$c;
echo ("$c\n");
}
Result: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181
wikipedia, how it works.
$a=0;
$b=1;
$c=0;
echo ("$a\n");
echo ("$b\n");
for ($i=0;$i<=17;$i++){
$c=$a+$b;
$a=$b;$b=$c;
echo ("$c\n");
}
Result: 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181
wikipedia, how it works.
Wazaaa, after a long time without posting, I decided to return to the blog showing my first game for iphone, it’s simple, served more as a study but it was pretty cool, soon put the source code of it.
In the meantime, some pictures.
That’s very simple, but is cool.

Landscape

Portrait

Game test 1

Game test 2
function shorterUrl($url){
$url=file_get_contents("http://tinyurl.com/api-create.php?url={$url}");
return $url;
}
echo shorterUrl("http://flaviomuniz.com.com/blog/url-shorter-using-tinyurl.html");
Result:
http://tinyurl.com/3hruebn

Simpels developed a class for sending sms, but remember, it’ll only funcinonar depending on the operator’s response is not only to test and find that it will work, has a number of rules of the carrier to make it work, but if you need to a project, your company will probably contact the operator and make some sort of contract for use.
I will make available for download codes in the “Free Codes”
Here the simple code.
First, let’s put the class.
class smsClass {
public $messages;
public $from;
public $carriers;
public $tryall;
function __construct($dotry = false){
$this->carriers = array(
'att' => 'txt.att.net',
'claro' => 'clarotorpedo.com.br',
'nextel' => 'messaging.nextel.com',
'vivo' => 'torpedoemail.com.br',
'orange' => 'orange.net'
);
$this->tryall = $dotry;
}
function message($carrier, $phone, $message) {
if($phone == '') {
return FALSE;
} else if($message == '' || strlen($message) > 140) {
return FALSE;
} else if($carrier == '' || !$carrier) {
if($this->tryall == TRUE) {
foreach($this->carriers as $carriername => $carrierconnection) {
$this->messages[] = array($carriername, $phone, $message);
}
return TRUE;
} else {
return FALSE;
}
} else {
$this->messages[] = array($carrier, $phone, $message);
return TRUE;
}
}
function send_messages() {
foreach($this->messages as $message) {
$carrier = $this->carriers[strtolower(str_replace(array('&', '-', '_'), '', $message[0]))];
$phone = strtolower(str_replace(array('+', '_', '-'), '', $message[1]));
$send = $phone . '@' . $carrier;
$message = $message[2];
mail($send, null, $message, 'From: ' . $this->from);
}
$this->messages = array();
}
function from($from){
$this->from = $from;
}
}
Now the page where you make the setting for the shipment.
require_once("smsClass.php");
$sms = new smsClass();
$sms->from('support@domain.com');
$status = $sms->message('carrie', 'number', 'message');
$sms->send_messages();
The use of DEFINE is important for several things, for example:
Sites with more than one language.
Set the system default url.
Url Set the root system.
Finally, a number of things we need and always do the worst possible sites using “. / Or ../’.
Anyway, do not need this anymore, if for example, define the default url of the site will be as follows:
define ('URL_SITE', "http://localhost/your_project/", true);
Using true you can use your definition in upper or lower case without it, an error will be displayed.
For a system with more than one language or even a language.
in your file name, e.g: eng.php
define ('LABEL_TEST', 'Label example ", true);
and
in your file name, e.g: pt_BR.php
define ('LABEL_TEST', "Sample Label", true);
And in your code you only print your label, so
echo LABEL_TEST
it is easier to have a system with several languages.
Pretty soon, if your system needs to login to be accessed, causes the user to choose a language on edit account, just remember to always leave a default language, you do not need login, you need to use cookies, this is a problem because it has users that do not allow cookies on their computers, you can consider it a problem or not, consider, advise the user that he must allow cookies in your browser, if not a problem, fuck it lol.
But anyway, this method is widely used, already used for some years, and today it decided to make a comment.
I hope you make good use of it in their projects.
Hello, I discovered this some time in css grid system that has helped me a lot in the projects.
A simple grid that will help you also in all the projects that can dynamically display columns
without breaking the layout and always keeping the same pattern.
Below, I will show how simple it is to use this grid system.

The result using values ??above this will be clear that the scale of the site, 960px and 940 total area used.

Now the css generated the grid will look like.
The css generated by grid 1
body{min-width:960px;}
.container_3{margin-left:auto;margin-right:auto;width:960px;}
.grid_1,.grid_2,.grid_3{display:inline;float:left;position:relative;margin-left:10px;margin-right:10px;}
.push_1,.pull_1,.push_2,.pull_2,.push_3,.pull_3{position:relative;}
.alpha{margin-left:0;}
.omega{margin-right:0;}
.container_3 .grid_1{width:300px;}
.container_3 .grid_2{width:620px;}
.container_3 .grid_3{width:940px;}
.container_3 .prefix_1{padding-left:320px;}
.container_3 .prefix_2{padding-left:640px;}
.container_3 .suffix_1{padding-right:320px;}
.container_3 .suffix_2{padding-right:640px;}
.container_3 .push_1{left:320px;}
.container_3 .push_2{left:640px;}
.container_3 .pull_1{left:-320px;}
.container_3 .pull_2{left:-640px;}
.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0;}
.clearfix:before,.clearfix:after{content:'\0020';display:block;
overflow:hidden;visibility:hidden;width:0;height:0;}
.clearfix:after{clear:both;}
.clearfix{zoom:1;}
In the case of a site that will use all the useful area of the monitor had been so.

The css generated by grid 2 ‘fluid’
.container_3{width:92%;margin-left:4%;margin-right:4%;}
.grid_1,.grid_2,.grid_3{display:inline;float:left;position:relative;margin-left:1%;margin-right:1%;}
.alpha{margin-left:0;}
.omega{margin-right:0;}
.container_3 .grid_1{width:31.333%;}
.container_3 .grid_2{width:64.667%;}
.container_3 .grid_3{width:98%;}
.container_3 .prefix_1{padding-left:33.333%;}
.container_3 .prefix_2{padding-left:66.667%;}
.container_3 .suffix_1{padding-right:33.333%;}
.container_3 .suffix_2{padding-right:66.667%;}
.container_3 .push_1{left:33.333%;}
.container_3 .push_2{left:66.667%;}
.container_3 .pull_1{left:-33.333%;}
.container_3 .pull_2{left:-66.667%;}
.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0;}
.clearfix:after{clear:both;content:' ';display:block;font-size:0;line-height:0;
visibility:hidden;width:0;height:0;}
.clearfix{display:block;}
* html .clearfix{height:1%;}
960grid | Custom css Grid | Example 1 | Example 2
Examples of sites using grid system.
More examples in 960.gs
Hello, I’ll show you how easy it is to highlight a word in a search using coffeescript, and then I will show the difference in the coffee and use jquery normal, and in the end, the result compiled coffeescript.
The code is much more organized and beautiful.
To call the function Search do as follows:
any_name = new Search();
any_name=highlight(“your param or quote”);
in Rails: any_name=highlight(“<%= params[:search] %>”);
in PHP: any_name=highlight(“<?php echo $_POST["search"]?>”); OR any_name=highlight(“<?php echo $_GET["search"]?>”);
Using CoffeeScript.
Using jQuery
Result Compiled of CoffeeScript
CoffeeScript code download here.
Hi, this is a simple animation using jquery.
Some time ago, I worked in an agency that has developed a giant touchscreen panel for a client, took about three months to develop, when I read the documentation, I said, I can do this with jquery, and not using flash , as the developer was a major flash-known owner of the agency, he decided to do in flash, well, were the nights of sleep lost to development, occurred at the end almost everything right, finally.
I left that agency, and decided to develop the same project using jquery, of course not had the patience to develop 100%, just wanted to show what was possible, did the main part of the project that was user interaction with the virtual beach. As you can see in the example below.
I will still finish the entire project, but that is for a next time.
The project in flash was really good, but wanted to show that there are other possibilities.
And congratulations to the agency for this great achievement.