This file contains 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 | |
$nomes = array(1 =>'Cássio', 'Weslley', 'Fábio'); | |
$tamanho_do_array = sizeof($nomes); | |
for($contador = 0; $contador <= $tamanho_do_array; $contador++) { | |
print $nomes[$contador] . PHP_EOL; | |
} | |
This file contains 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
#! /usr/bin/python | |
# -*- coding: iso-8859-1 -*- | |
# Dependencias pynotify e xprintidle | |
import commands | |
import time | |
import pynotify | |
msg = 'Computador idle por mais de 5 minutos. Pegue café.' | |
limit = 3000000 |
This file contains 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 | |
class Convert_Abstraction_AbstractFactory { | |
public function __construct() { | |
} | |
public static function convert($to) { | |
This file contains 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 | |
class Abstract_Factory_Convert_JPG extends Convert_Abstraction_Factory { | |
const EXTENSION = '.jpg'; | |
public function __construct() { | |
parent::__construct(); | |
} | |
public function image_convert($img) { |
This file contains 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 iFactory { | |
public function image_convert($img); | |
} | |
abstract class Convert_Abstraction_Factory implements iFactory { | |
const IMG_PATH = './img'; | |
const TMP_PATH = './tmp'; |
This file contains 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 | |
class Abstract_Factory_Convert_PNG extends Convert_Abstraction_Factory { | |
const EXTENSION = '.png'; | |
public function __construct() { | |
parent::__construct(); | |
} | |
public function image_convert($img) { |
This file contains 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
#! /usr/bin/python | |
# -*- coding: iso-8859-1 -*- | |
# Dependencias pynotify e xprintidle | |
import commands | |
import time | |
import pynotify | |
msg = 'Computador inativo por mais de 1 minuto. Pegue café.' |
This file contains 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 Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/220100525/mysql.so' | |
- /usr/lib/php5/220100525/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 | |
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/220100525/mysqli.so' | |
- /usr/lib/php5/220100525/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0 | |
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/220100525/pdo_mysql.so' | |
- /usr/lib/php5/220100525/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 | |
PHP 5.4.0RC7-dev (cli) (built: Jan 29 2012 17:15:56) | |
Copyright (c) 1997-2012 The PHP Group | |
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies |
This file contains 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 | |
$array = [ | |
'isto', 'eh', 'um', 'array', 'com', 'varios', 'itens', 'e', 'indice', 'numerico' | |
]; | |
print_r($array); | |
/* output | |
Array |
This file contains 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 | |
$array = [ | |
'isto', 'eh', 'um', 'array', 'com', 'varios', 'itens', 'e', 'indice', 'numerico' | |
]; | |
echo implode(' ', $array); | |
//output: isto eh um array com varios itens e indice numerico |
OlderNewer