Skip to content

Instantly share code, notes, and snippets.

View casimiroarruda's full-sized avatar
🖊️
Keep Writing

Anderson Casimiro casimiroarruda

🖊️
Keep Writing
View GitHub Profile
@casimiroarruda
casimiroarruda / Command.php
Last active March 6, 2017 00:18
Gist to support article on blog
<?php
namespace Duodraco\Foundation\Command;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
abstract class Command extends Controller
{
/**
@casimiroarruda
casimiroarruda / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@casimiroarruda
casimiroarruda / config.sh
Created July 22, 2014 13:56
Build environment ubuntu 14.04 simple
#!/bin/bash
#install ubuntu 14.04 server, LAMP + Openssh server stacks
echo '# 2nd networkcard' >> /etc/network/interfaces
echo 'auto eth1' >> /etc/network/interfaces
echo 'iface eth1 inet dhcp' >> /etc/network/interfaces
/etc/init.d/networking restart
ifup eth1
apt-get update && apt-get upgrade
#reboot
{
"name": "duodraco/interconphp-todo",
"description": "Repository for InterconPHP Challenge",
"minimum-stability": "stable",
"license": "MIT",
"authors": [
{
"name": "Anderson Casimiro",
"email": "o@duodra.co"
}
{
"name":"7maters",
"require":{
"php":"5.3.*",
"monolog/monolog":"1.5.*"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project name="7masters-2" default="start">
<target name="start" depends="composer,update,dirs"/>
<target name="composer">
<available file="composer.phar" property="composer.exists"/>
<echo msg="${composer.exists}"/>
<if>
<not>
<isset property="composer.exists"/>
</not>
<?xml version="1.0" encoding="UTF-8"?>
<project name="7masters-1" default="start">
<target name="start" depends="step-a,step-b,step-c"/>
<target name="step-a">
<echo msg="Este é o Projeto ${phing.project.name}"/>
</target>
<target name="step-b">
<echo msg="Nunca chegaremos ao Passo C :D"/>
<php expression="11/0" returnProperty="erro" level="error"/>
<fail if="erro" msg="Você está vendo esta pois há um erro"/>
<?php
namespace Community;
use Location\SaoPaulo;
$you = new User();
$phpsp = new Community(
new SaoPaulo()
);
$phpsp->welcome($you);
@casimiroarruda
casimiroarruda / build.properties
Created September 10, 2012 02:52
Exemplo de arquivo de variáveis externas para o exemplo de buildfile phing 2
project.name=LeProject
vendor=Duodraco
version=0.0.1
lista.generica=a,b,c
@casimiroarruda
casimiroarruda / build.xml
Created September 10, 2012 02:47
Exemplo de buildfile phing 2
<?xml version="1.0"?>
<project basedir="." default="start">
<property file="build.properties" />
<target name="start" depends="cleanup,dirs,bootstrap,frontcontroller" />
<target name="cleanup">
<delete dir="application" includeemptydirs="true" verbose="false" failonerror="true" />
<delete dir="vendor" includeemptydirs="true" verbose="false" failonerror="true" />
<delete dir="tests" includeemptydirs="true" verbose="false" failonerror="true" />
<delete dir="web" includeemptydirs="true" verbose="false" failonerror="true" />
<delete dir="log" includeemptydirs="true" verbose="false" failonerror="true" />