Skip to content

Instantly share code, notes, and snippets.

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

Tiago Brito tlfbrito

🏠
Working from home
View GitHub Profile
@jakzal
jakzal / KernelAwareTest.php
Last active June 27, 2024 16:20
KernelAwareTest
<?php
require_once dirname(__DIR__).'/../../../../app/AppKernel.php';
/**
* Test case class helpful with Entity tests requiring the database interaction.
* For regular entity tests it's better to extend standard \PHPUnit_Framework_TestCase instead.
*/
abstract class KernelAwareTest extends \PHPUnit_Framework_TestCase
{
@coreymcmahon
coreymcmahon / DefaultController.php
Created May 5, 2012 03:01
Usage of the Symfony form object in a Controller - http://www.symfonycentral.com
<?php
/* ... rest of the controller */
/**
* @Route("/article/add", name="post_add")
* @Template()
*/
public function addAction()
{
$form = $this->createFormBuilder()
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active September 24, 2024 14:52 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@Ocramius
Ocramius / HashCracker.php
Last active January 1, 2016 04:49
Timing Attack simulation - just a very simple dummy to help understanding timing attacks. https://twitter.com/Ocramius/status/415055831608991744
<?php
require_once __DIR__ . '/stupidStringComparison.php';
class HashCracker
{
private $range = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
private $length = 32;
private $cycles = 1000;
@kevingessner
kevingessner / gist:9509148
Last active April 27, 2023 15:45
Responsive emails that really work -- From Etsy's Code As Craft blog: http://codeascraft.com/2014/03/13/responsive-emails-that-really-work
<html>
<head>
<style type="text/css">
table table {
width: 600px !important;
}
table div + div { /* main content */
width: 65%;
float: left;
}