Skip to content

Instantly share code, notes, and snippets.

@rlandas
rlandas / routes.php
Created October 11, 2012 12:03 — forked from robertbasic/routes.php
ZF2 Nice and clean routes with Part
<?php
$slugConstraints = '[\w_-]+';
$pagenumberChild = array(
'type' => 'segment',
'options' => array(
'route' => '/page/:page',
'constraints' => array(
'page' => '\d+'
#--- Ubuntu 13.10 Saucy Salamander
#-
#- Basic packages i usually install
#
# Update and Upgrade
sudo apt-get update
sudo apt-get upgrade
# Graphics
#############################################################################
## 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
<?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 / ubuntu_14_04.sh
Last active August 29, 2015 14:06 — forked from h4cc/Makefile
#--- Ubuntu 14.04 LTS (Trusty Tahr)
#-
#- Basic packages i usually install
#
# - Run with:
# sudo apt-get -y install git ; git clone https://gist.github.com/7be7f940325614dc59fb.git provision ; cd provision ; sh ubuntu_14_04.sh
# Update and Upgrade
sudo apt-get update
sudo apt-get upgrade
@rlandas
rlandas / .htaccess
Last active August 29, 2015 14:06 — forked from ericmagnuson/.htaccess
Using LESS with Apache2
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule (.*\.min.css) less.php?min=yes&path=$1
RewriteRule (.*\.css) less.php?min=no&path=$1
</IfModule>
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default
@rlandas
rlandas / api.php
Last active August 29, 2015 14:07
<?php
function array_orderby() {
$args = func_get_args();
$data = array_shift( $args );
if ( ! is_array( $data ) ) {
return array();
}
@rlandas
rlandas / Makefile
Last active November 11, 2015 10:13 — forked from h4cc/Makefile
UBUNTU Install packages
#
# Ubuntu 14.04 LTS (Trusty Tahr)
#
# Basic packages i usually install
#
# Author: Julius Beckmann <github@h4cc.de>
#
.PHONY: all update upgrade graphics darktable networking google_chrome dropbox archives media pandoc system harddisk docker filesystem apache2 php mysql memcached mongodb tools encfs_manager nautilus httpie erlang elixir openoffice owncloud