Skip to content

Instantly share code, notes, and snippets.

View akhyaruu's full-sized avatar
🧙
Creating magic (ノ≧∀≦)ノ・‥…━━━★

Akhyar akhyaruu

🧙
Creating magic (ノ≧∀≦)ノ・‥…━━━★
View GitHub Profile
public function index($nomor_kasus)
{
$kasus = Kasus::with('pasien')->where('nomor_kasus',$nomor_kasus)->first();
$data['kasus'] = $kasus;
$data['sidebar_active'] = 'alat';
$data['hasil'] = AlatBantu::where('type', 'ews-system-dewasa')->where('kasus_id', $kasus->id)->orderBy('created_at', 'desc')->get();
for ($i=0; $i < count($data['hasil']); $i++) {
$data['hasil'][$i]->val = json_decode($data['hasil'][$i]->val);
}
import java.sql.*;
public class JDBCExample {
static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
static final String DB_URL = "jdbc:mysql://localhost/EMP";
static final String USER = "username";
static final String PASS = "password";
public static void main(String[] args) {
Connection conn = null;
const request = new Request;
const jsonData = {
id: 42,
title: 'Meaning of Life',
};
const getJsonResponse = request.get("https://httpbin.org/get");
getJsonResponse.then(data => data).then(data => console.log(data));
@akhyaruu
akhyaruu / 6
Created September 13, 2019 11:47
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Ajax 3 - External API</title>
<style>
.user {
@akhyaruu
akhyaruu / 5
Created September 13, 2019 09:57
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Ajax 2 - Local JSON</title>
</head>
@akhyaruu
akhyaruu / 4
Last active September 12, 2019 15:25
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Index</title>
</head>
@akhyaruu
akhyaruu / 3
Created September 12, 2019 15:06
xhr.onload = function () {
if (this.status == 200) {
document.getElementById('text').innerHTML = this.responseText;
} else if (this.status == 404) {
document.getElementById('text').innerHTML = 'Not Found';
}
}
@akhyaruu
akhyaruu / 2
Created September 12, 2019 13:55
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Index</title>
</head>
@akhyaruu
akhyaruu / 1
Last active September 12, 2019 13:54
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Index</title>
</head>