Skip to content

Instantly share code, notes, and snippets.

View krolow's full-sized avatar

Vinícius Krolow krolow

View GitHub Profile
@krolow
krolow / docker-clean.sh
Created September 30, 2015 17:17
Docker aliases/bash
docker rm $(docker ps -aq)
@krolow
krolow / docker-solution-unresposive-insecure-endpoint.md
Created September 22, 2015 12:33
docker.errors.DockerException: HTTPS endpoint unresponsive and insecure mode isn't enabled.

Docker compose error docker.errors.DockerException: HTTPS endpoint unresponsive and insecure mode isn't enabled.

$ docker-compose pull --allow-insecure-ssl

--allow-insecure-ssl

@krolow
krolow / .git-commit-template.txt
Last active May 23, 2016 03:45
Git template
# [Title] Capitalized, short (50 chars or less) summary, write message in imperative
# [Body] Detailed explanation (72 chars or less), can make usage of markdow, bullet lists...
# [Number/Ticket/Issue] References to issues solved
@krolow
krolow / PHP_Exceptions.md
Last active December 12, 2015 04:08
PHP Exceptions

BadFunctionCallException

Exception thrown if a callback refers to an undefined function or if some arguments are missing.

BadMethodCallException

Exception thrown if a callback refers to an undefined method or if some arguments are missing.

DomainException

@krolow
krolow / MetaTrait.php
Last active October 4, 2019 15:32
PHP Meta Programming PHP 5.4
<?php
trait MetaTrait
{
private $methods = array();
public function addMethod($methodName, $methodCallable)
{
if (!is_callable($methodCallable)) {
throw new InvalidArgumentException('Second param must be callable');
@krolow
krolow / qa.sh
Created December 10, 2012 13:55
Quality Assurance PHP
#!/bin/bash
echo "======================================================================================="
echo "Fixing code standard"
echo "======================================================================================="
php-cs-fixer fix $PWD/src/
echo "Ok done ;)"
echo ""
echo "======================================================================================="
echo "Lets see the mess in our code"
echo "======================================================================================="
@krolow
krolow / Meta.php
Created December 2, 2012 16:45
PHP Adding method dynamically, meta programming example in PHP 5.3
<?php
/**
* Example in PHP 5.3
*/
class Meta
{
private $methods = array();
public function addMethod($methodName, $methodCallable)
@krolow
krolow / create-project.php
Created September 20, 2012 18:45
Create Project PHP - sudo create-project.php name_of_project /path/of/project
<?php
/*
* Template of virtual host
*/
$template = "<VirtualHost *:80>\n";
$template .= "ServerName {$argv[1]}\n";
$template .= "DocumentRoot {$argv[2]}\n";
$template .= "<Directory {$argv[2]}>\n";
$template .= " Options Indexes FollowSymLinks MultiViews\n";