Skip to content

Instantly share code, notes, and snippets.

View fabioluciano's full-sized avatar
🏠
Working from home

Fábio Luciano fabioluciano

🏠
Working from home
View GitHub Profile
<?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;
}
#! /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
<?php
class Convert_Abstraction_AbstractFactory {
public function __construct() {
}
public static function convert($to) {
<?php
class Abstract_Factory_Convert_JPG extends Convert_Abstraction_Factory {
const EXTENSION = '.jpg';
public function __construct() {
parent::__construct();
}
public function image_convert($img) {
<?php
interface iFactory {
public function image_convert($img);
}
abstract class Convert_Abstraction_Factory implements iFactory {
const IMG_PATH = './img';
const TMP_PATH = './tmp';
<?php
class Abstract_Factory_Convert_PNG extends Convert_Abstraction_Factory {
const EXTENSION = '.png';
public function __construct() {
parent::__construct();
}
public function image_convert($img) {
#! /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é.'
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
<?php
$array = [
'isto', 'eh', 'um', 'array', 'com', 'varios', 'itens', 'e', 'indice', 'numerico'
];
print_r($array);
/* output
Array
<?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