This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//na parte de interface de usuário, faça com que o value | |
//contenha apenas o valor numérico do mês | |
echo '<select name="parametro">'; | |
foreach (range(1, 12) as $month) { | |
printf('<option value="%d">%02d</option>', $month, $month); | |
} | |
echo '</select>'; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Example; | |
class Customer | |
{ | |
private $id; | |
private $firstName; | |
private $lastName; | |
private $email; | |
private $company; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mask($input, $input_pattern, $output_pattern) | |
{ | |
return vsprintf($output_pattern, sscanf($input, $input_pattern)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'php-captcha.inc.php'; | |
# // define fonts | |
$fonts = '/home/guga/public_html/232classificados/captcha/fonts/'; | |
$aFonts = array( | |
$fonts . 'VeraBd.ttf', | |
$fonts . 'VeraIt.ttf', | |
$fonts . 'Vera.ttf' | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array(2) { | |
'começa com "de"' => | |
array(3) { | |
[0] => | |
string(7) "destino" | |
[1] => | |
string(9) "delimitar" | |
[2] => | |
string(7) "debugar" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ICONV="iconv -f UTF-8 -t ISO-8859-1" | |
find $1 -type f -iname "*.html" | while read fn; do | |
cp ${fn} ${fn}.utf8 | |
$ICONV < ${fn}.utf8 > ${fn} | |
rm ${fn}.utf8 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface Contract { | |
public function range($a, $b) { | |
pre {$a and $b must be an integer} | |
pos {$return must be greater than or equals $a AND less than $b} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example; | |
public class Something { | |
public int sum(int a, int b) { | |
return a + b; | |
} | |
public double sum(double x, double y) { | |
return x + y; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Test(value) { | |
this.value = value; | |
} | |
Test.prototype.toString = function() { | |
return 'The value is ' + this.value; | |
}; | |
var t = new Test(10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NameVirtualHost 127.0.0.2:80 | |
<Directory "/var/www/html/example/"> | |
Options -Indexes +FollowSymLinks | |
AllowOverride All | |
Order allow,deny | |
Allow from all | |
</Directory> | |
<VirtualHost 127.0.0.2:80> |