This file contains hidden or 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
# file: /laravel-project/.env.example | |
APP_NAME=Laravel | |
APP_ENV=local | |
APP_KEY= | |
APP_DEBUG=true | |
APP_URL=http://localhost | |
APP_SERVICE=laravel.test | |
APP_PORT=8000 |
This file contains hidden or 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 | |
\Illuminate\Support\Facades\Schema::create('z_user', function ($table) { | |
$table->uuid('user_id'); | |
$table->json('skills'); | |
}); | |
\Illuminate\Support\Facades\DB::table('z_user')->insert([ | |
['user_id' => \Illuminate\Support\Str::uuid(), 'skills' => '["coding", "baseball", "soccer"]'], | |
['user_id' => \Illuminate\Support\Str::uuid(), 'skills' => '["coding", "public-speaking"]'], |
This file contains hidden or 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 | |
header('Content-Type: application/json'); | |
function get_uptime() | |
{ | |
$str = @file_get_contents('/proc/uptime'); | |
$num = floatval($str); | |
$secs = (int) fmod($num, 60); $num = intdiv($num, 60); | |
$mins = $num % 60; $num = intdiv($num, 60); |
This file contains hidden or 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
#!/bin/bash | |
# DateTime | |
now=`date +"%Y/%m/%d %H:%M:%S"` | |
# Memory Total | |
mem_total=`grep 'MemTotal' /proc/meminfo | awk '{print $2}'` | |
mem_total=$(expr $mem_total / 1024) #KB to MB | |
# Memory Used |
This file contains hidden or 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
#!/bin/bash | |
# copy this file to /usr/local/bin/ | |
# usage: dim 0.5 -> 0.5 is the brightness | |
screen=($(xrandr -q | grep -w 'connected')) | |
xrandr --output $screen --brightness $1 |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Lorem 101</title> | |
</head> | |
<style type="text/css"> | |
body {text-align: center;} | |
.red {color: red;} | |
.green {color: green;} | |
.brown {color: brown;} |
This file contains hidden or 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
#!/usr/bin/env python3 | |
''' | |
17 Apr 2017 JKT DHE | |
[email protected] | |
skrip python untuk membedakan angka ganjil dan genap | |
Penggunaan: python ganjilgenap.py [angka] | |
-> python3 ganjilgenap.py 9 |