Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Munk schmunk42

View GitHub Profile
View gist:6124928
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 Aug 20, 2013
Configure language fallbacks for application and core message catalogues.
View yii-language-fallback-config
'coreMessages' => array(
'class' => 'P3PhpMessageSource',
'basePath' => '../vendor/yiisoft/yii/framework/messages'
),
'messages' => array(
'class' => 'P3PhpMessageSource',
),
@schmunk42
schmunk42 / BizRule.php
Created Aug 29, 2013
Yii RBAC bizrules with data example
View BizRule.php
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 Dec 23, 2015
Sample provider function for rendering custom inputs with gtc
View gtc-provider.php
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 Oct 27, 2013
Phundament Install Log (116c23f4c61d920c28f9048f90d192de7a6f008a)
View gist:7187838
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 Jan 18, 2014
bug report vagrant-berkshelf
View terminal.out
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 Feb 20, 2014
log of the first full-automatic Phundament installation on AWS EC2
View Phundament 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
View templay-0.0.0.0.1.html
<!-- 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
View GiibatchController.php
<?php
namespace app\commands;
use yii\console\Controller;
use yii\helpers\Inflector;
/**
* @author Tobias Munk <schmunk@usrbin.de>
*/
@schmunk42
schmunk42 / user.sql
Created Mar 28, 2014
Yii 2 User Extension Data Model
View user.sql
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',