Skip to content

Instantly share code, notes, and snippets.

View cebe's full-sized avatar
☁️
working on cebe.cloud

Carsten Brandt cebe

☁️
working on cebe.cloud
View GitHub Profile
<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'location',
'date',
array(
'label'=>'attendees',
'value'=>$model->attendees!=null ? null : $model->attendees->username,
),
<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'location',
'date',
array(
'label'=>'attendees',
array(
'attendees'=>$model->attendees!=null ? ' ' : $model->attendees->username),
@cebe
cebe / view.php
Created March 8, 2015 00:31
using array_map to format array data
<?php
$names = array_map(function($attendee) { return $attendee->username; }, $model->attendees);
print_r($names);
E/AndroidRuntime(27220): FATAL EXCEPTION: main
E/AndroidRuntime(27220): java.lang.RuntimeException: Unable to start activity ComponentInfo{tox.utox/android.app.NativeActivity}: java.lang.IllegalArgumentException: Unable to load native library: /data/app-lib/tox.utox-1/libn.so
E/AndroidRuntime(27220): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2306)
E/AndroidRuntime(27220): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
E/AndroidRuntime(27220): at android.app.ActivityThread.access$600(ActivityThread.java:156)
E/AndroidRuntime(27220): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1340)
E/AndroidRuntime(27220): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(27220): at android.os.Looper.loop(Looper.java:153)
E/AndroidRuntime(27220): at android.app.ActivityThread.main(ActivityThread.java:5299)
E/AndroidRuntime(27220): at java.lang.reflect.Method.invokeNative(Native Method)
@cebe
cebe / composer.lock
Last active April 10, 2020 15:29
composer.lock example
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "8ca6b6b80bab36b5287b4292abee988f",
"packages": [
{
"name": "bower-asset/bootstrap",
@cebe
cebe / makealldocs.sh
Last active August 29, 2015 14:09
script to generate all the docs for yii2
#!/bin/sh
YII_PATH=~/dev/github/yiisoft/yii2
APIDOC_PATH=~/dev/github/yiisoft/yii2/extensions/apidoc
OUTPUT=outtest
cd $APIDOC_PATH
./apidoc api $YII_PATH/framework/,$YII_PATH/extensions $OUTPUT/api --guide=../guide-en --interactive=0
./apidoc guide $YII_PATH/docs/guide $OUTPUT/guide-en --apiDocs=../api --interactive=0
./apidoc guide $YII_PATH/docs/guide-ru $OUTPUT/guide-ru --apiDocs=../api --interactive=0
@cebe
cebe / BaseController.php
Created October 25, 2014 19:41
Yii2 API Auth with username and password
<?php
/**
*
*
* @author Carsten Brandt <[email protected]>
*/
namespace api\components;
use common\models\ApiSystem;
@cebe
cebe / test.sh
Created October 22, 2014 20:21
variable name in shell misinterpreted.
#!/bin/sh
FOO="test"
BAR="123"
VAR="$FOO_$BAR"
# result is "123" instead of "test_123" because _ is seen as part of the var.
# how can I fix this?
@cebe
cebe / composer.json
Created September 18, 2014 21:31
A really big composer.json file
{
"name": "symfony/symfony",
"type": "library",
"description": "The Symfony PHP framework",
"keywords": ["framework"],
"homepage": "http://symfony.com",
"license": "MIT",
"authors": [
{
"name": "Fabien Potencier",
@cebe
cebe / mail.php
Created June 11, 2014 22:19
dynamic config
<?php
$config = [];
// do fancy things here
return $config;