Skip to content

Instantly share code, notes, and snippets.

View mdmunir's full-sized avatar

Misbahul D Munir mdmunir

View GitHub Profile
<?php
namespace app\classes;
use Yii;
use yii\db\BaseActiveRecord;
use yii\db\Query;
use yii\db\ActiveQuery;
use yii\helpers\Inflector;
use yii\helpers\StringHelper;
@mdmunir
mdmunir / Helper.php
Created August 10, 2016 09:44
Serializer for API Rest
<?php
namespace classes\data;
use yii\base\Model;
/**
* Description of Helper
*
* @author Misbahul D Munir <[email protected]>
<?php
namespace app\controllers;
use Yii;
use mdm\upload\FileModel;
use yii\web\NotFoundHttpException;
use yii\imagine\Image;
use yii\helpers\FileHelper;
<h1>Welcome to CodeIgniter!</h1>
<div id="body">
<table width="100%">
<tbody>
<?php foreach($users as $user): ?>
<tr>
<th><?= $user->id?></th>
<td><?= $user->username?></td>
<td><?= $user->email?></td>
<?php
namespace App\Console\Commands;
use Yii;
use Illuminate\Console\Command;
use App\models\larva\User as LarvaUser;
use app\models\yii\User as YiiUser;
class TestORM extends Command
<?=
GridInput::widget([
'allModels' => $model->orderItems,
'model' => \app\models\OrderItem::className(),
'form' => $form,
'columns' => [
['class' => 'mdm\widgets\SerialColumn'],
[
'attribute' => 'name',
'widget' => ['kartik\select2\Select2', [
<?=
GridInput::widget([
'id' => 'detail-grid',
'allModels' => $model->items,
'model' => OrderItem::className(),
'columns' => [
['class' => 'mdm\widgets\SerialColumn'],
'product_id',
'qty',
[
@mdmunir
mdmunir / index.php
Created May 22, 2017 09:07
Yii2 Angualjs Route
<?php
use yii\web\View;
use dee\angularjs\NgRoute;
//use yii\helpers\Html;
/* @var $this View */
?>
<div ng-app="test">
@mdmunir
mdmunir / ImageController.php
Last active July 9, 2017 01:07
Yii2 Tinymce widget
<?php
namespace app\controllers;
use Yii;
use mdm\upload\FileModel;
use yii\web\NotFoundHttpException;
use yii\imagine\Image;
use yii\helpers\FileHelper;
use yii\web\UploadedFile;
@mdmunir
mdmunir / timer_hidroponik.ino
Created August 9, 2017 05:30
Timer untuk pompa hidroponik menggunakan arduino nano dan rtc 1307 serta keypad
#include <Wire.h>
#include <RealTimeClockDS1307.h>
#include <EEPROM.h>
#include <Keypad.h>
//RealTimeClock RTC;//=new RealTimeClock();
#define SET_TIME 't'
#define SWITCH_ON '1'
#define SWITCH_OFF '0'