Skip to content

Instantly share code, notes, and snippets.

Avatar

Ade Guntoro adeguntoro

View GitHub Profile
@adeguntoro
adeguntoro / prime.php
Created Nov 13, 2019
Check all prime number
View prime.php
<?php
$count = 0;
$num = 2;
while ( $count < 15 ){
$div_count = 0 ;
for ( $i=1; $i<=$num; $i++){
if (($num%$i)==0) {
$div_count++;
}
}
View php looping
<?php
$f = new NumberFormatter("id", NumberFormatter::SPELLOUT);
echo "#####################<br>";
echo $f->format(5)."<br>";
$a = $f->format(169);
$pisah = explode(" ", $a);
echo "#####################<br>";
echo "foreach array<br>";
foreach($pisah as $key) {
echo $key.'<br/>';
View contoller
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class Checkbox extends Controller {
public function index()
{
//
return view('checkbox.index');
}
View controller
<?php
namespace App\Http\Controllers;
use App\Form;
use Illuminate\Http\Request;
class FormController extends Controller
{
@adeguntoro
adeguntoro / arrival_time.php
Created Oct 31, 2019
Menghitung Waktu kedatangan
View arrival_time.php
<?php
$distance = 2000; //KM
$average_speed = 19; //KMh
$travel_time = $distance / $average_speed;
$departure_time = "2019-05-30 12:30:56";
$split = explode(".", $travel_time);
$hours = $split[0];
@adeguntoro
adeguntoro / controller
Created Oct 24, 2019
dynamic vs static form
View controller
dynamic form controller :
public function store(Request $request) {
dd($request->post());
}
#####################
static form controller :
public function store(Request $request) {
dd($request->post());
}
View Database and Model
//database
Schema::create('reseps', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('nama_masakan');
$table->string('foto_masakan');
$table->string('nama_kategori');
$table->json('bahan');
$table->longText('langkah');
$table->timestamps();
});
View updating_ruby_with_rvm_on_a_mac.md

RBENV

  • rbenv install -l
  • rbenv install 2.4.3
  • rbenv local 2.4.3
  • gem bundler install
  • bundle install

RVM