Skip to content

Instantly share code, notes, and snippets.

@AntonioCS
AntonioCS / redo_entity.sh
Created November 26, 2015 14:53
Create or recreate a doctrine2 entity
#!/bin/sh
bundle=$1
entity=$2
php app/console doctrine:mapping:import --filter=$entity $bundle xml
php app/console doctrine:mapping:convert --force --filter=$entity annotation ./src
php app/console doctrine:generate:entities $bundle:$entity
@AntonioCS
AntonioCS / Scripting\PHP Class
Last active November 25, 2015 16:21
Netbeans Template for PHP Class
<?php
<#assign licenseFirst = "/* ">
<#assign licensePrefix = " * ">
<#assign licenseLast = " */">
<#include "${project.licensePath}">
<#if namespace?? && namespace?length &gt; 0>
<#assign strings = namespace?split("\\")>
<#assign package = strings[0]>
<#assign category = namespace?substring(namespace?index_of("\\") + 1)>
@AntonioCS
AntonioCS / gist:5129826
Created March 10, 2013 18:47
A simple hex to RGB converterd. Based on code from http://bavotasan.com/2011/convert-hex-color-to-rgb-using-php/
<?php
//Based on http://bavotasan.com/2011/convert-hex-color-to-rgb-using-php/
class hex2rgb {
private static $_cache = array();
private function __construct() {
}