Skip to content

Instantly share code, notes, and snippets.

@rlandas
rlandas / gist:4368879
Created December 24, 2012 11:23
GIT: Commit from one repository to another repository
git clone https://github.com/cakephp/cakephp
git push [email protected]:mg/cakephp.git master
@rlandas
rlandas / gist:4664243
Created January 29, 2013 13:30
ZF2: I need a universal method to initialize various elements (before action), without duplicating my code in every other controller action. Settings were just an example. Reference: http://zend-framework-community.634137.n4.nabble.com/ZF2-Doing-something-before-calling-the-controller-action-td4656922.html#a4656934
For universal solution you may want to try this one, it will work for all Controllers within single Module:
class Module
{
// Evan's changing layout for specific module only
public function init(ModuleManager $moduleManager) {
$sharedEvents = $moduleManager->getEventManager()->getSharedManager();
$sharedEvents->attach(__NAMESPACE__, 'dispatch', function($e) {
$controller = $e->getTarget();
// do your stuff with controller
@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 #
#--- 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: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
#############################################################################
## 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: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" />
@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:11181712
Created April 22, 2014 14:38
Hide browser chrome on mobile Safari
<meta name="apple-mobile-web-app-capable" content="yes" />