Skip to content

Instantly share code, notes, and snippets.

<?php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
$config = new \Doctrine\ORM\Configuration();
@rlandas
rlandas / gist:11181742
Last active August 29, 2015 14:00
PHP: convert HEX colour to RGB
<?php
// convert 'theme settings' hex values to rgb
function hex2rgb($hex) {
$hex = str_replace("#", "", $hex);
if(strlen($hex) == 3) {
$r = hexdec(substr($hex,0,1).substr($hex,0,1));
$g = hexdec(substr($hex,1,1).substr($hex,1,1));
$b = hexdec(substr($hex,2,1).substr($hex,2,1));
} else {
@rlandas
rlandas / gist:11181712
Created April 22, 2014 14:38
Hide browser chrome on mobile Safari
<meta name="apple-mobile-web-app-capable" content="yes" />
@rlandas
rlandas / gist:11181685
Created April 22, 2014 14:37
Home Screen bookmark icon for iPhone
<link rel="apple-touch-icon" href="/path/to/icon.png" />
@rlandas
rlandas / gist:11181652
Created April 22, 2014 14:36
Set the color of the status bar on iPhone
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
#############################################################################
## data source definitions
#############################################################################
source users
{
# data source type. mandatory, no default value
# known types are mysql, pgsql, mssql, xmlpipe, xmlpipe2, odbc
type = mysql
#############################################################################
## data source definitions
#############################################################################
source users
{
# data source type. mandatory, no default value
# known types are mysql, pgsql, mssql, xmlpipe, xmlpipe2, odbc
type = mysql
@rlandas
rlandas / gist:8876246
Last active August 29, 2015 13:56
ubuntu config
# Apache modules to enable
a2enmod php5 actions alias cache allowmethods dump_io expires headers include log_config log_debug mime_magic rewrite setenvif session session_cookie ssl status vhost_alias
#--- Ubuntu 13.10 Saucy Salamander
#-
#- Basic packages i usually install
#
# Update and Upgrade
sudo apt-get update
sudo apt-get upgrade
# Graphics
@rlandas
rlandas / gist:6927443
Last active December 25, 2015 05:49
GIT ignore file - taken from GitHub (@see https://help.github.com/articles/ignoring-files) - added some from multiple sources - added ZF2 related files and folders
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #