This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 Install redis-server | |
sudo apt-get install redis-server | |
#2 Install php5-redis | |
sudo apt-get install php5-redis | |
#3 Restart apache2 server | |
sudo service apache2 restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author andidepe11@gmail.com | |
*/ | |
// Instantiate Class Redis dan koneksikan php dengan redis | |
$redis = new Redis(); | |
$redis->connect('127.0.0.1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Array literal | |
al = [1933, "Persib Juara ISL 2014", 11] | |
#Mengakses array dari kiri | |
al[0] #output => 1933 | |
al[1] #output => "Persib Juara ISL 2014" | |
al[2] #output => 11 | |
#Mengakses array dari kanan | |
al[-3] #output => 1933 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>title</title> | |
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$('#sel div a').click(function(){ | |
console.log( this.rel ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Controller; | |
use App\Controller\AppController; | |
// Use Link Helper Class | |
use App\View\Helper\LinkHelper; | |
/** | |
* ProductCategories Controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\View\Helper; | |
use Cake\View\Helper; | |
class LinkHelper extends Helper | |
{ | |
public $helpers = ['Html']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateQuestionsAndAnswersTables extends Migration | |
{ | |
/** | |
* Run the migrations. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+------------+------------------+------+-----+---------+----------------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+------------+------------------+------+-----+---------+----------------+ | |
| id | int(10) unsigned | NO | PRI | NULL | auto_increment | | |
| title | varchar(255) | NO | | NULL | | | |
| body | mediumtext | NO | | NULL | | | |
| created_at | timestamp | YES | | NULL | | | |
| updated_at | timestamp | YES | | NULL | | | |
+------------+------------------+------+-----+---------+----------------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Seeder; | |
class QuestionsTableSeeder extends Seeder | |
{ | |
/** | |
* Run the database seeds. | |
* | |
* @return void |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Seeder; | |
class AnswersTableSeeder extends Seeder | |
{ | |
/** | |
* Run the database seeds. | |
* | |
* @return void |
OlderNewer