Skip to content

Instantly share code, notes, and snippets.

View joesoeph's full-sized avatar

Yusuf Fazeri joesoeph

View GitHub Profile
@joesoeph
joesoeph / example-vuex-using-helper.js
Last active July 30, 2022 12:53
Example using vuex using map helper
// in this case Folder structure using nuxt.
// store/example.js
export const state = () => ({
dataInput: "Hello guys!"
})
export const actions = {
setDataInput({ commit }, payload) {
commit('dataInput', payload.target.value)
@joesoeph
joesoeph / example-emit-2.js
Last active August 5, 2022 15:36
Example 2 Emit Vue JS
// ExampleTrigger.vue
<template>
<div>
<input type="text" @input="hello" :value="sayText" />
<p>{{ sayText }}</p>
</div>
</template>
<script>
export default {
props: {
@joesoeph
joesoeph / example-emit.js
Last active August 5, 2022 15:31
Example using emit vue js
// ExampleTrigger.vue
<template>
<div>
<button @click="hello">click me</button>
<!-- OR -->
<!-- <button @click="$emit('say-hello)">click me</button> -->
<p>{{ sayText }}</p>
</div>
</template>
<script>
@joesoeph
joesoeph / example.php
Created July 23, 2022 15:05
PHP Update Huge Rows Using Pagination
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class UpdatePassword extends CI_Controller {
public function index()
{
$this->load->view('welcome_message');
}
public function doUpdate()
@joesoeph
joesoeph / nuxt.config.js
Created July 18, 2022 13:04
example about nuxt.config.js for local nuxt auth strategies
// https://auth.nuxtjs.org/schemes/local
auth: {
redirect: {
login: '/auth/login', // defualt login page
callback: '/auth/callback' // default login callback
},
strategies: {
local: {
token: {
@joesoeph
joesoeph / nuxt.config.js
Last active July 18, 2022 13:00
This is example about nuxt auth strategies in nuxt.config.js for google auth using own server backend
// Documentation you should read:
// https://github.com/nuxt-community/auth-module/blob/dev/src/schemes/oauth2.ts
// https://auth.nuxtjs.org/providers/google
// https://auth.nuxtjs.org/schemes/oauth2
auth: {
strategies: {
google: {
token: {
type: 'Bearer',
/*
** Dibuat oleh: Yusuf Fazeri
** No. Peserta: 123456789101-102
*/
/*
** [PRAKTIK - 01] | Urutan perintah yang dilakukan untuk membuat database marketdb dan dengan nama collection-nya products adalah....
*/
use marketdb;
db.createCollection("products");
@joesoeph
joesoeph / 102-101_yusuf_fazeri_mongodts_pro_2021_dok.txt
Last active September 13, 2021 13:58
Contoh file dokumentasi PRACTICAL EXAM MongoDB DTS Pro 2021
/*
** Dibuat oleh: Yusuf Fazeri
** No. Peserta: 123456789101-102
*/
/*
** [PRAKTIKAL - 01] | Syntax query operator untuk mencari data dari collection employees yang umurnya tidak lebih dari 50 tahun adalah....
*/
db.employees.find({age: { $lte: 50 }})
db.products.insertMany([
{
_id: 1,
name: "Indomie Ayam Bawang",
price: 3000,
stock: 30,
unit: "pcs",
description: "Harga jual perbungkus",
categories: ["makanan", "mie"],
suppliers: [
@joesoeph
joesoeph / event-close-script.twig
Last active June 25, 2021 12:20
Event Close twig PHP
{% set dateNow = date|date('Y-m-d H:i') %}
{% if(dateNow >= '2021-04-08 00:00') %}
// event is closed
<div class="col-12">
<div class="alert alert-info" role="alert">
<h4 class="alert-heading">Info</h4>
<p>Terimakasih atas partisipasi kamu dalam event ini. <strong>Saat ini event telah ditutup.</strong></p>
</div>
</div>
{% endif %}