Skip to content

Instantly share code, notes, and snippets.

View wesleywillians's full-sized avatar

Wesley Willians wesleywillians

View GitHub Profile
<?php
declare(strict_types=1);
return [
// Provides application-wide services.
// We recommend using fully-qualified class names whenever possible as
// service names.
'dependencies' => [
// Use 'aliases' to alias a service name to another service. The
@wesleywillians
wesleywillians / download-composer
Created June 20, 2019 01:13
Nginx.conf e Linha para baixar o composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
USE [master]
GO
if not exists(select * from sys.databases where name = 'SqlTrainingOnlineSimpleDB')
CREATE DATABASE [SqlTrainingOnlineSimpleDB]
GO
USE [SqlTrainingOnlineSimpleDB]
GO
switch $name {
case (preg_match('/John.*/', $name) ? true : false) :
// do stuff for people whose name is John, Johnny, ...
break;
}
<?php
namespace Code;
abstract class AbstractFactoryMethod
{
abstract function getLivroPHP($idoma);
}
@wesleywillians
wesleywillians / gist:0be6c2e851e9e5145c5d
Created July 5, 2014 13:17
Redirecionamento nginx
location / {
try_files $uri $uri/ /index.php?$args;
}
function git_branch_name() {
git branch 2>/dev/null | grep -e '^*' | sed -E 's/^\* (.+)$/(\1) /'
}
function show_colored_git_branch_in_prompt() {
PS1="\[\033[38m\]\h:\[\033[032m\]\W\[\033[31m\]\$(git_branch_name)\[\033[m\]$ "
}
show_colored_git_branch_in_prompt
@wesleywillians
wesleywillians / gist:8342214
Created January 9, 2014 21:18
Suporte vitalício para curso online. Tem gente que não sabe o que fala.
Tem gente por aí criando pseudo-curso, se achando o bam-bam-bam, e diz que da suporte vitalício aos alunos.
1 - Para um aluno precisar de suporte vitalício é que o professor deve ser tão ruim que aluno demorará a eternidade para aprender.
2 - Oferecer suporte vitalício para meia dúzia de gatos pingados é fácil. Quando fizer isso para 15.000 alunos, aí vem me criticar.
3 - Ops, Não emite nota fiscal né... Izzi, acho que é porque não tem nem CNPJ (porque será que não tem??). Sonegar imposto é coisa feia viu ;)
---
public function getServiceConfig()
{
return array(
'factories' => array(
'Cache' => function($sm) {
$config = $sm->get('Config');
$cache = \Zend\Cache\StorageFactory::factory(
array(
'adapter' => 'memcached',
'memcached' => array(
public function getServiceConfig()
{
return array(
'factories' => array(
'Cache' => function($sm) {
$config = $sm->get('Config');
$cache = \Zend\Cache\StorageFactory::factory(
array(
'adapter' => 'memcached',
'ttl' => 3600,