Skip to content

Instantly share code, notes, and snippets.

View pedromazala's full-sized avatar
🥋

Pedro Mázala pedromazala

🥋
View GitHub Profile
class PHPXSL_xp extends XSLTProcessorClass {
function run() {
// xml document
$oXML = new DomDocument();
$realXML = String::replace(File::openFile($this->_sXML), array('encoding="utf-8"', 'encoding="UTF-8"', 'encoding="ISO-8859-1"', 'encoding="iso-8859-1"'), '');
$encodedXML = Util::isUTF8($realXML) ? utf8_encode($realXML) : utf8_encode(utf8_encode($realXML));
$oXML->loadXml($encodedXML);
$oXML->xinclude();
#include <stdio.h>
#include <stdlib.h>
int main()
{
int idade = 0;
int idadeT = 0;
int contador = 0;
float media = 0;
void Util::get3DMatrix(int pLinear, int* triDimensional, int X, int Y, int Z) {
int x, y, z;
int tamanho = ((X * Y) * Z);
y = ((pLinear % tamanho) % Y);//bloco
x = ((pLinear % tamanho) / Y) % X;//dia
z = pLinear / tamanho;//camada
triDimensional[0] = y;
triDimensional[1] = x;
<?php
print "<pre>";
$pedidoTotal = 40;
$pedidos = [
['necessario' => 10, 'estoque' => 20],
['necessario' => 20, 'estoque' => 15],
['necessario' => 10, 'estoque' => 5]

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
class Child extends Father
{
public function entrypoint()
{
}
}
version: "2.0"
services:
foo:
image: "nginx:alpine"
volumes:
- "arbitrary-repo-name:/one"
- "arbitrary-repo-namee:/two"
volumes:
<?php
function qualquer() {
$array = [];
for ($i = 1; $i <= 12; $i++)
$array[str_pad($i, 2, "0", STR_PAD_LEFT) . '/' . date('Y')] = 0;
}
// faz a query que tu tem que fazer...
@pedromazala
pedromazala / WSSoapClient.php
Created December 26, 2017 18:03 — forked from mathdev/WSSoapClient.php
WS-Security for PHP SoapClient
<?php
/**
* Copyright (c) 2007, Roger Veciana
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
@pedromazala
pedromazala / password.php
Created September 19, 2018 14:28
Simple password generator
<?php
function getPassword(int $pass_length = 6): string
{
$possible_keys = str_split("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890@#$%&_.,;?!");
$last_key = null;
$pass = '';
while (strlen($pass) <= $pass_length) {
$key = rand(0, count($possible_keys) - 1);