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 | |
$time = microtime(TRUE); | |
function formatPeriod($endtime, $starttime) | |
{ | |
$duration = $endtime - $starttime; | |
$hours = (int) ($duration / 60 / 60); | |
$minutes = (int) ($duration / 60) - $hours * 60; | |
$seconds = (int) $duration - $hours * 60 * 60 - $minutes * 60; | |
return ($hours == 0 ? "00":$hours).":".($minutes == 0 ? "00":($minutes < 10? "0".$minutes:$minutes)).":".($seconds == 0 ? "00":($seconds < 10? "0".$seconds:$seconds)); |
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 | |
$novadata = implode('-', array_reverse(explode('-', $date))); |
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 | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
apt-get update | |
apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev make | |
mkdir -p /etc/php7/conf.d | |
mkdir -p /etc/php7/cli/conf.d | |
mkdir /usr/local/php7 |
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
I use the first | |
—– BEGIN LICENSE —– | |
Michael Barnes | |
Single User License | |
EA7E-821385 | |
8A353C41 872A0D5C DF9B2950 AFF6F667 | |
C458EA6D 8EA3C286 98D1D650 131A97AB | |
AA919AEC EF20E143 B361B1E7 4C8B7F04 |
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
FROM centos:centos6 | |
MAINTAINER Caio Mariano | |
RUN yum -y update; | |
RUN yum -y install httpd; | |
RUN yum -y install php php-mbstring php-mysql; | |
RUN curl --silent --location https://rpm.nodesource.com/setup | bash -; | |
RUN yum -y install nodejs; | |
RUN npm install -g npm@latest; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="./slick/slick/slick.css"/> | |
<link rel="stylesheet" type="text/css" href="./slick/slick/slick-theme.css"/> | |
<title></title> | |
<style type="text/css"> | |
.tamanho{ | |
font-size: 35px; | |
border: solid 1px black; |
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
var letters = /^[A-Za-z]+$/; | |
var numbers = /^[0-9]+$/; | |
if(name.match(letters) && name.length <=15){ | |
alert("do something!"); | |
}else{ | |
alert("Please Enter Name in Alphabet only..."); | |
} | |
if(price.match(numbers) && price.length <=5){ |
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 | |
$dt = date("d/m/Y h:i:s", strtotime($dados["dt_bd"])); |
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 | |
public function __get($property) | |
{ | |
if(!property_exists($this,$property)) | |
{ | |
throw new InvalidArgumentException("Propriedade {$property} inexistente!"); | |
} | |
return $this->$property; | |
} |
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
var http = require('http'); | |
var api = { | |
path : function(estado,cargo,partido,nome){ | |
var api = '/api/v1/candidatos?estado='+estado+'&cargo='+cargo; | |
if(partido != null){ | |
api += '&partido='+partido; | |
} | |
if(nome != null){ |
NewerOlder