Skip to content

Instantly share code, notes, and snippets.

View pedromazala's full-sized avatar
🥋

Pedro Mázala pedromazala

🥋
View GitHub Profile
@pedromazala
pedromazala / monorepo.sh
Last active March 13, 2020 14:14
Including external package
#!/usr/bin/env bash
set -e
git checkout master
git pull --rebase
git remote add remote-$1 [email protected]:ebanx/$1.git
git fetch remote-$1
git checkout -b package/$1 remote-$1/master
@pedromazala
pedromazala / engzap.php
Created March 19, 2019 01:48
EngZap example
<?php
use GuzzleHttp\Client;
require __DIR__ . '/../vendor/autoload.php';
class EngZapAuth
{
private static $token;
@pedromazala
pedromazala / index.php
Created February 15, 2019 02:12
EngZap - PHP curl example
<?php
/**
* Created by PhpStorm.
* User: pedromazala
* Date: 14/02/2019
* Time: 23:18
*/
$base_url = 'http://localhost:8000';
@pedromazala
pedromazala / Program.cs
Last active March 8, 2019 13:03
EngZap Example C# .Net
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
namespace TetsteCSharp
class Program
{
static void Main(string[] args)
@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);
@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
<?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...
version: "2.0"
services:
foo:
image: "nginx:alpine"
volumes:
- "arbitrary-repo-name:/one"
- "arbitrary-repo-namee:/two"
volumes:
class Child extends Father
{
public function entrypoint()
{
}
}

1. Clone your fork:

git clone [email protected]: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