Skip to content

Instantly share code, notes, and snippets.

View schmunk42's full-sized avatar

Tobias Munk schmunk42

View GitHub Profile
@schmunk42
schmunk42 / Bootstrap.php
Created April 20, 2014 01:37
Yii 2 module bootstrap
<?php
/**
* @link http://www.diemeisterei.de/
* @copyright Copyright (c) 2014 diemeisterei GmbH, Stuttgart
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace schmunk42\sakila;
@schmunk42
schmunk42 / gist:f9b9658580c4f59c570c
Created July 4, 2014 06:13
Phundament shallow clone git update
Kraftbuch:test tobias$ git clone --depth=1 -b 4.0 https://github.com/phundament/app.git app-4
Kraftbuch:test tobias$ cd app-4
Kraftbuch:app-4 tobias$ git log
commit b828ad302ee5ff3138367d9d005b3ce14918c3d3
Author: Tobias Munk <schmunk@usrbin.de>
Date: Thu Jul 3 14:58:01 2014 +0200
added git-hook for detecting composer lock changes
@schmunk42
schmunk42 / config.php
Created July 6, 2014 20:33
config with markers
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-backend', #value:id#
@schmunk42
schmunk42 / PhundamentController.php
Created July 7, 2014 10:07
Yii application init
<?php
/**
* @link http://www.diemeisterei.de/
* @copyright Copyright (c) 2014 diemeisterei GmbH, Stuttgart
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace console\controllers;
@schmunk42
schmunk42 / post-merge
Created August 17, 2014 23:28
git hook to check changes in composer lock file with PHP
#!/usr/bin/php
<?php
/**
* Hook to tell you, when you have to trigger composer install
*
* Installation:
*
* cd .git/hooks/
* ln -s ../../git-hooks/post-merge .
*/
@schmunk42
schmunk42 / phundament-4.0.0-beta1-install.log
Created October 16, 2014 23:43
Phundament 4.0.0-beta1 Installation Log
$ composer create-project --stability=beta phundament/app:4.0.* app-v4-beta1
Installing phundament/app (4.0.0-beta1)
- Installing phundament/app (4.0.0-beta1)
Cloning 8ddc349022caa11db0f13cae50bb23e97e4d68d1
Created project in app-v4-beta1
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing bower-asset/jquery (2.1.1)
Cloning 4dec426aa2a6cbabb1b064319ba7c272d594a688
@schmunk42
schmunk42 / _nav.php
Created January 11, 2015 21:47
Module controllers navigation pills (Phundament 4)
<ul class="nav nav-pills">
<?php
foreach (\Yii::$app->getModule('admin')->getControllers($this->context->module->id) AS $i => $controller):
?>
<li role="presentation">
<?= yii\helpers\Html::a(
$controller,
["/{$this->context->module->id}/$controller"],
['class' => 'btn btn-default btn-flat']
); ?>
@schmunk42
schmunk42 / docker-kill-sh
Created February 6, 2015 13:08
Killed 1000 and 1 Docker containers
Kraftbuch:Desktop tobias$ docker kill $(docker ps -a -q)
3e6702868b88
5e016c7d72ab
115f3dc7fe62
948aa7850412
b0c817b4b220
ff372e6ede6b
637f0ae741f4
e932f9dc1355
c6af5af7455b
@schmunk42
schmunk42 / index.php
Created February 9, 2015 21:51
Yii2 module default view, showing all controllers in module (requires dmstr/yii2-application metadata)
<?php
use yii\helpers\Inflector;
?>
<div class="crud-default-index">
<h1><?= $this->context->action->uniqueId ?></h1>
<div class="box">
@schmunk42
schmunk42 / tree
Created February 10, 2015 19:35
Phundament directory structure
$ tree
├── CHANGELOG.md
├── Dockerfile
├── LICENSE.md
├── README.md
├── Vagrantfile
├── assets
│   ├── AppAsset.php
│   ├── less