Skip to content

Instantly share code, notes, and snippets.

View dcsg's full-sized avatar
🏠
Working from home

Daniel Gomes dcsg

🏠
Working from home
View GitHub Profile
@dcsg
dcsg / pre-commit_lint
Created April 9, 2019 13:00
Git hooks
#!/bin/bash
# required to be able to input the response
exec < /dev/tty
# require to exit the docker container and kill the process
trap printout SIGINT
printout() {
exit
}
Verifying myself: My Bitcoin username is +dcsg. https://onename.io/dcsg

Keybase proof

I hereby claim:

  • I am dcsg on github.
  • I am dcsg (https://keybase.io/dcsg) on keybase.
  • I have a public key whose fingerprint is 3DC4 39A2 3906 0E0B B657 52D0 D39E E963 4F98 A4AD

To claim this, I am signing this object:

# language: pt
Funcionalidade: Player can issue a challenge
In order to find a suitable opponent
As an online chess player
I want to be able to issue a challenge
Cenário: Start game if there is a suitable opponent online
Dado am a player rated 1600
E I accept a threshold of 200 points
@dcsg
dcsg / File.php
Last active August 29, 2015 13:55
<?php
// ...
class File
{
/**
* @Id
* @GeneratedValue
* @Column(type="bigint")
@dcsg
dcsg / HelloWorldCommand.php
Created January 9, 2014 14:19
Code examples for my blog about the new feature for Symfony Console Component - set a default command
namespace Acme\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class HelloWorldCommand extends Command
{
protected function configure()
{
@dcsg
dcsg / guidelines.md
Last active December 31, 2015 03:28
SymfonyCon Hacking Day
@dcsg
dcsg / category.php
Created October 21, 2013 00:31
Add talks by year to my wordpress blog.
<?php
/**
* The template for displaying Category Archive pages.
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
get_header(); ?>
@dcsg
dcsg / install.txt
Created July 13, 2013 13:46
Workshop Git and Github for Startups
Vagrant 1.2.2 - http://downloads.vagrantup.com/tags/v1.2.2
Virtual Box 4.2.12 - https://www.virtualbox.org/wiki/Download_Old_Builds_4_2
Git - http://git-scm.com/downloads
@dcsg
dcsg / preg_replace.php
Last active December 16, 2015 10:49
Search inside a string for a regex expression and output the matches with some modification (in this case in bold)
<?php
$expression = 'here we got a number 23 % and so on';
$pattern = '/(\d+ %)/';
$replacement = '<b>$1</b>';
echo preg_replace($pattern, $replacement, $expression);