Skip to content

Instantly share code, notes, and snippets.

@rohman
rohman / Page.php
Created December 2, 2013 11:16
L4 Blog Models Page.php
<?php namespace App\Models;
class Page extends Eloquent
{
protected $table = 'pages';
public function author()
{
return $this->belongsTo('User');
}
@rohman
rohman / Article.php
Created December 2, 2013 11:15
L4 Blog Models Article.php
<?php namespace App\Models;
class Article extends Eloquent
{
protected $table = 'articles';
public function author()
{
return $this->belongsTo('User');
}
@rohman
rohman / CreatePagesTable.php
Last active December 30, 2015 00:09
L4 Blog Migration Create Pages Table
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePagesTable extends Migration {
/**
* Run the migrations.
*
@rohman
rohman / CreateArticleTable.php
Last active December 30, 2015 00:09
L4 Blog Migration Create Article Table
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateArticlesTable extends Migration {
/**
* Run the migrations.
*
@rohman
rohman / composer
Created December 2, 2013 11:07
L4 Blog composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.0.*",
"cartalyst/sentry": "2.0.*",
"dflydev/markdown": "v1.0.2",
"imagine/Imagine": "v0.4.1"
@rohman
rohman / ng-filter.html
Created June 5, 2013 11:43
Contoh penggunaan ng-filter & ng-repeat
<!DOCTYPE html>
<html>
<head>
<title>Angular Binding</title>
<link rel="stylesheet" href="assets/foundation/foundation.css" />
</head>
<body>
<div ng-app="MyApp">
<div ng-controller="AvengerCtrl">
<input type="text" ng-model="search.$"/>
@rohman
rohman / main.js
Created May 23, 2013 08:49
angular main.js
function FirstCtrl($scope)
{
$scope.data = {message:"halow"}
}
@rohman
rohman / angular_controllers.html
Created May 23, 2013 08:46
angular_controllers
<!DOCTYPE html>
<html>
<head>
<title>Angular Binding</title>
<link rel="stylesheet" href="assets/foundation/foundation.css" />
</head>
<body>
<div ng-app="">
<div ng-controller="FirstCtrl">
<h1>{{data.message + " World"}}</h1>
<!DOCTYPE html>
<html>
<head>
<title>Angular Binding</title>
<link rel="stylesheet" href="assets/foundation/foundation.css" />
</head>
<body>
<div ng-app="">
<input type="text" ng-model="data.message" />
<h1>{{data.message + " World"}}</h1>
@rohman
rohman / database.php
Created April 17, 2013 23:21
CodeIgniter ODBC Connection
<?php
$active_group = 'default';
$active_record = FALSE;
$db['default']['hostname'] = 'Driver={SQL Server};Server=127.0.0.1;Database=databasenya; Uid=sa;Pwd=sa;';
$db['default']['username'] = 'sa';
$db['default']['password'] = 'sa';
$db['default']['database'] = 'databasenya';
$db['default']['dbdriver'] = 'odbc';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;