Skip to content

Instantly share code, notes, and snippets.

View schmunk42's full-sized avatar

Tobias Munk schmunk42

View GitHub Profile
@schmunk42
schmunk42 / gist:6124928
Created July 31, 2013 18:49
The big giic
Kraftbuch:app-crud tobias$ php vendor/schmunk42/giic/giic.php giic generate sakila
Attention! The command may overwrite exisiting files wihtout further notice.
Enable overwrite all existing files? (yes|no) [no]:y
FullModelCode - actor, Actor, sakila.models.gtc, default
Generating code using template "/app-crud/vendor/schmunk42/yii-sakila-crud/../../../vendor/phundament/gii-template-collection/fullModel/templates/default"...
skipped config/../../vendor/schmunk42/yii-sakila-crud/models/gtc/Actor.php
skipped config/../../vendor/schmunk42/yii-sakila-crud/models/gtc/BaseActor.php
@schmunk42
schmunk42 / yii-language-fallback-config
Created August 20, 2013 09:20
Configure language fallbacks for application and core message catalogues.
'coreMessages' => array(
'class' => 'P3PhpMessageSource',
'basePath' => '../vendor/yiisoft/yii/framework/messages'
),
'messages' => array(
'class' => 'P3PhpMessageSource',
),
@schmunk42
schmunk42 / BizRule.php
Created August 29, 2013 07:31
Yii RBAC bizrules with data example
class BizRule
{
/**
* Compares the data structure of AuthItem and AuthAssignment
* Attach this Bizrule to be an AuthItem, to compare the data structure of the AuthItem and
* assignment specified in itemname.
*
* @param $params
* @param $data
* @param $itemname
@schmunk42
schmunk42 / gtc-provider.php
Last active December 23, 2015 13:19
Sample provider function for rendering custom inputs with gtc
public function generateActiveField($model, $column)
{
if ($column->autoIncrement) {
return false;
}
switch ($column->name) {
case 'created_at':
case 'updated_at':
return "echo \$form->textField(\$model,'{$column->name}',array('disabled'=>'disabled'))";
@schmunk42
schmunk42 / gist:7187838
Created October 27, 2013 21:02
Phundament Install Log (116c23f4c61d920c28f9048f90d192de7a6f008a)
Kraftbuch:TESTING tobias$ composer.phar create-project --prefer-dist "phundament/app:dev-develop"
Installing phundament/app (dev-develop 116c23f4c61d920c28f9048f90d192de7a6f008a)
- Installing phundament/app (dev-develop develop)
Downloading: 100%
Created project in /Users/tobias/Webserver/TESTING/app
____ _ _ _
| _ \| |__ _ _ _ __ __| | __ _ _ __ ___ ___ _ __ | |_
| |_) | '_ \| | | | '_ \ / _` |/ _` | '_ ` _ \ / _ \ '_ \| __|
| __/| | | | |_| | | | | (_| | (_| | | | | | | __/ | | | |_
@schmunk42
schmunk42 / terminal.out
Created January 18, 2014 12:58
bug report vagrant-berkshelf
Kraftbuch:cookbook-gitlab tobias$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'precise64'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[Berkshelf] This version of the Berkshelf plugin has not been fully tested on this version of Vagrant.
[Berkshelf] You should check for a newer version of vagrant-berkshelf.
[Berkshelf] If you encounter any errors with this version, please report them at https://github.com/RiotGames/vagrant-berkshelf/issues
[Berkshelf] You can also join the discussion in #berkshelf on Freenode.
@schmunk42
schmunk42 / Phundament on AWS EC2
Created February 20, 2014 14:44
log of the first full-automatic Phundament installation on AWS EC2
$ vagrant up
Bringing machine 'default' up with 'aws' provider...
[fog][WARNING] Unable to load the 'unf' gem. Your AWS strings may not be properly encoded.
[default] Warning! The AWS provider doesn't support any of the Vagrant
high-level network configurations (`config.vm.network`). They
will be silently ignored.
[default] Launching an instance with the following settings...
[default] -- Type: t1.micro
[default] -- AMI: ami-a850c898
[default] -- Region: us-west-2
@schmunk42
schmunk42 / templay-0.0.0.0.1.html
Last active August 29, 2015 13:56
Templaytemplate
<!-- Home Section -->
<div id="home" class="section">
<div class="fixed-wrapper"><h1>Columns</h1></div>
<div class="container">
<com:Template> <!-- id="col-12" description="Full width template" -->
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<h2 tpy:editable>12 Columns</h2>
<p tpy:editable>Sed tempus dignissim felis, nec placerat elit sagittis vel. Praesent porttitor erat
at
@schmunk42
schmunk42 / GiibatchController.php
Last active August 29, 2015 13:57
Yii2 Giibatch
<?php
namespace app\commands;
use yii\console\Controller;
use yii\helpers\Inflector;
/**
* @author Tobias Munk <schmunk@usrbin.de>
*/
@schmunk42
schmunk42 / user.sql
Created March 28, 2014 18:31
Yii 2 User Extension Data Model
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'The KEY obviously',
`username` varchar(20) NOT NULL DEFAULT '' COMMENT 'Login name (alnum)',
`email` varchar(128) NOT NULL DEFAULT '' COMMENT 'User e-mail address',
`password` varchar(128) NOT NULL DEFAULT '' COMMENT 'Secure password hash',
`auth_client` varchar(128) NOT NULL DEFAULT '' COMMENT 'Eg. local, LDAP, GitHub, Twitter, Facebook, ...',
`auth_key` varchar(128) NOT NULL DEFAULT '' COMMENT 'External ID',
`activation_key` varchar(128) NOT NULL DEFAULT '' COMMENT 'Key to activate the account, sent by email',
`superuser` int(1) NOT NULL DEFAULT '0' COMMENT '** Not sure if needed, IMHO should be implemented in another way **',
`status` int(1) NOT NULL DEFAULT '0' COMMENT 'Eg. registered,confirmed,activated,banned',