Skip to content

Instantly share code, notes, and snippets.

View schmunk42's full-sized avatar

Tobias Munk schmunk42

View GitHub Profile
@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
@schmunk42
schmunk42 / giiant
Created February 10, 2015 19:49
Generating extensions via CLI with Gii
./yii gii/extension \
--vendorName=dmstr \
--packageName=yii2-application-info \
--namespace=dmstr\\modules\\backend\\ \
--license=BSD-3-Clause \
--title="Extended application information for Yii 2.0 Framework" \
--description="Provides in-depth configuration and application information" \
--authorName="Tobias Munk" \
--authorEmail=tobias@diemeisterei.de
@schmunk42
schmunk42 / Vagrantfile
Created February 28, 2015 01:08
Vagrantfile for a dockerhost
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.synced_folder "./", "/vagrant", type: "rsync"
# Access docker container via private_network interface
# Port mapping to this IP can be defined in the Vagrantfile of the container
config.vm.network "private_network", ip: "192.168.3.3", netmask: "255.255.255.0"
@schmunk42
schmunk42 / docker-ps
Created March 6, 2015 01:21
docker ps with scaling
Kraftbuch:~ tobias$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
147224c0610c mariadb:latest "/docker-entrypoint. 2 minutes ago Up 2 minutes 3306/tcp playground_db_1
c5895d1f7938 redis:latest "/entrypoint.sh redi 2 minutes ago Up 2 minutes 6379/tcp playground_redis_1
2202a4c7ede8 091d8fc7f5fd "/root/run.sh" 5 minutes ago Up 5 minutes 0.0.0.0:49184->80/tcp playground_prodweb_9
151240a93e87 091d8fc7f5fd "/root/run.sh" 5 minutes ago Up 5 minutes 0.0.0.0:49183->80/tcp playground_prodweb_8
951048fa14ab 091d8fc7f5fd "/root/run.sh" 5 minutes ago Up 5 minutes 0.0.0.0:49182->80/tcp playground_prodweb_7
@schmunk42
schmunk42 / assets-prod.php
Created March 9, 2015 10:49
Phundament Playground Production Assets
<?php
/**
* This file is generated by the "yii asset" command.
* DO NOT MODIFY THIS FILE DIRECTLY.
* @version 2015-03-06 06:45:46
*/
return [
'frontend' => [
'class' => 'yii\\web\\AssetBundle',
'basePath' => '@app/web/assets-prod',
@schmunk42
schmunk42 / Dockermake
Created March 12, 2015 10:53
Dockermake
.PHONY: all build default release
default: build
all: build
build: yii2 phundament
yii2:
docker build -t schmunk42/php-yii2:cli stacks/yii2/stack/php-cli