Skip to content

Instantly share code, notes, and snippets.

View brpaz's full-sized avatar

Bruno Paz brpaz

View GitHub Profile
@chalasr
chalasr / EnhancedRepository.php
Last active September 26, 2023 00:59
Implements a custom EntityRepository using Factory in Symfony2.6+
<?php
namespace App\Util\Doctrine\Repository;
use App\Util\Doctrine\Entity\AbstractEntity;
use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\ORM\EntityRepository;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\UnprocessableEntityHttpException;
@thoroc
thoroc / sf2-set-permissions.sh
Created December 14, 2015 14:06
Bash script to automatically set the permissions for Symfony2 based on the official docs (current version 2.8)
#!/bin/bash
#
# script to automatically set the permission for the cache and logs folder
# for a new symfony2 project.
# original code taken from the documentation pages:
# http://symfony.com/doc/current/book/installation.html
BASEFOLDER="";
if [ "$1" != "" ]; then
BASEFOLDER="$1";
/**
* Required Variables.
*/
variable "name" {}
variable "port" {}
variable "elb_security_group" {}
variable "elb_subnets" {}
@lusis
lusis / README.md
Last active September 14, 2020 17:47
terraform template to generate serverspec properties

This uses terraform's template_file resource to generate a yaml properties file for serverspec to use.

  • create the Rakefile in your terraform project root
  • create a spec directory and put spec_helper.rb in it
  • create the templates/properties.tmpl.yml file
  • create the serverspec.tf
  • terraform apply

tests

Tests will be matched based on roles defined for a given node.

@lukemadera
lukemadera / docker-create-swarm.sh
Created September 25, 2015 15:56
jwilder/nginx-proxy using Compose + Swarm + Machine attempt 1
#!/bin/bash
set -e
if [ -z "$DIGITALOCEAN_ACCESS_TOKEN" ]; then
echo >&2 "ERROR: You must export DIGITALOCEAN_ACCESS_TOKEN"
exit 1
fi
docker pull swarm > /dev/null
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 5, 2025 01:35
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@ldong
ldong / download_egghead_videos.md
Last active December 7, 2023 16:16
download egghead videos

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App

run

$.each($('h4 a'), function(index, video){
  console.log(video.href);
});
@ianblenke
ianblenke / cloudformation-template_vpc-iam.json
Created June 27, 2015 18:55
AWS CloudFormation Template example for VPC with IAM Instance Profile
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "MyApp VPC",
"Parameters" : {
"Project" : {
"Description" : "Project name to tag resources with",
"Type" : "String",
"MinLength": "1",
"MaxLength": "16",
"AllowedPattern" : "[a-z]*",
@ajaxray
ajaxray / symfony2-bundle-config.md
Last active February 7, 2019 12:02
Symfony2 - Getting Bundle configuration from app/config/config.yml as a separated config block

APPROACH 1: Getting it as a parameter

With an extension (more on extensions here) you can keep this easily "separated" into different blocks in the config.yml and then inject that as a parameter gettable from the controller.

Inside your Extension class inside the DependencyInjection directory write this:

class MyNiceProjectExtension extends Extension
{
 public function load( array $configs, ContainerBuilder $container )
@bulv1ne
bulv1ne / fabfile.py
Created May 19, 2015 13:25
Docker fabfile
import os
import sys
from fabric.api import cd, env, lcd, local, parallel, roles, run
from fabric.context_managers import settings
from fabric.contrib.console import confirm
from fabric.decorators import runs_once
env.use_ssh_config = True