View query-1.sql
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
SELECT level, COUNT(id) AS jml | |
FROM soal | |
GROUP BY level; |
View form-ajax.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
<!DOCTYPE html> | |
<html lang="id" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<title>AJAX Submit Form</title> | |
</head> | |
<body> | |
<form action="kirim-proses.php" method="post" id="formulir"> | |
<input type="text" name="nama" placeholder="Nama Lengkap"><br> | |
<input type="email" name="email" placeholder="Email"><br> |
View preferences.sql
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
SELECT | |
MAX(CASE WHEN (pref_name = 'smtp_host') THEN pref_value ELSE NULL END) AS smtp_host, | |
MAX(CASE WHEN (pref_name = 'smtp_port') THEN pref_value ELSE NULL END) AS smtp_port, | |
MAX(CASE WHEN (pref_name = 'smtp_user') THEN pref_value ELSE NULL END) AS smtp_user, | |
MAX(CASE WHEN (pref_name = 'smtp_pass') THEN pref_value ELSE NULL END) AS smtp_pass | |
FROM preferences | |
WHERE pref_group = 'email'; |
View App.vue
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
// App.vue | |
<template> | |
<div id="app"> | |
<sidebar title="Mantap"></sidebar> | |
<h1>{{message}}</h1> | |
<p class="good">{{count}}</p> | |
<button v-on:click="increment">increment</button> | |
<p>{{user.name}}</p> | |
<feature-item v-for="feature in features" :key="feature.id" :feature="feature"></feature-item> |
View FeatureItem.vue
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
// FeatureItem.vue | |
<template> | |
<div v-bind:style="{ color: textColor }" v-on:click="toggleColor"> | |
<h2>{{ feature.name }}</h2> | |
<p>{{ feature.description }}</p> | |
</div> | |
</template> | |
<script> |
View app.js
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
// js/app.js | |
import Vue from 'vue' | |
import App from '../components/App.vue' | |
import { createStore } from './store' | |
const store = createStore() | |
const app = new Vue({ | |
store, | |
render: h => h(App) |
View store.js
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
// js/store.js | |
import Vue from 'vue' | |
import Vuex from 'vuex' | |
Vue.use(Vuex) | |
export function createStore() { | |
return new Vuex.Store({ | |
state: { |
View app-server.js
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
import renderVueComponentToString from "vue-server-renderer/basic"; | |
import app from "./app"; | |
app.$store.commit("setUser", { user: context.user }); | |
app.$store.state.features = context.features; | |
renderVueComponentToString(app, (err, html) => { | |
if (err) { | |
throw new Error(err); | |
} |
View index.php
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 | |
require_once __DIR__ . '/../vendor/autoload.php'; | |
use Spatie\Ssr\Renderer; | |
use Spatie\Ssr\Engines\Node; | |
$features = [ | |
['id' => 1, 'name' => 'NVMe SSD Super Cepat', 'description' => '100% Enterprise NVMe SSD untuk performa website secepat kilat'], | |
['id' => 2, 'name' => 'Cloud Backup', 'description' => 'Backup harian ke Cloud menjamin keamanan data penting anda'] | |
]; | |
$engine = new Node("/home/andika/.nvm/versions/node/v14.17.1/bin/node", __DIR__.'/../dist'); |
OlderNewer