Skip to content

Instantly share code, notes, and snippets.

View wesleywillians's full-sized avatar

Wesley Willians wesleywillians

View GitHub Profile
'translateAdapter' => array (
'parameters' => array (
'options' => array(
'locale' => 'pt-br',
'content' => '/caminho/para/traducao',
'scan' => 'filename',
'disableNotices' => true
)
)
),
public function getServiceConfig()
{
return array(
'factories' => array(
'SONUser\Mail\Transport' => function($sm) {
$config = $sm->get('Config');
$transport = new SmtpTransport();
$options = new SmtpOptions($config['mail']);
$transport->setOptions($options);
public function getServiceConfig()
{
return array(
'factories' => array(
'Cache' => function($sm) {
$config = $sm->get('Config');
$cache = \Zend\Cache\StorageFactory::factory(
array(
'adapter' => 'memcached',
'ttl' => 3600,
public function getServiceConfig()
{
return array(
'factories' => array(
'Cache' => function($sm) {
$config = $sm->get('Config');
$cache = \Zend\Cache\StorageFactory::factory(
array(
'adapter' => 'memcached',
'memcached' => array(
@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 ;)
---
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:0be6c2e851e9e5145c5d
Created July 5, 2014 13:17
Redirecionamento nginx
location / {
try_files $uri $uri/ /index.php?$args;
}
<?php
namespace Code;
abstract class AbstractFactoryMethod
{
abstract function getLivroPHP($idoma);
}
switch $name {
case (preg_match('/John.*/', $name) ? true : false) :
// do stuff for people whose name is John, Johnny, ...
break;
}
USE [master]
GO
if not exists(select * from sys.databases where name = 'SqlTrainingOnlineSimpleDB')
CREATE DATABASE [SqlTrainingOnlineSimpleDB]
GO
USE [SqlTrainingOnlineSimpleDB]
GO