Skip to content

Instantly share code, notes, and snippets.

View fahmiegerton's full-sized avatar
🕳️
tired from all of this

Arif Fahmi fahmiegerton

🕳️
tired from all of this
View GitHub Profile
This file has been truncated, but you can view the full file.
[
{
"name": "Icy Bay Airport",
"kota": "Icy Bay",
"country": "US",
"country_name": "",
"pnr": 0,
"unix_offset": -28800,
"deleted": 0,
"_id": "60a3d818045fd93f38efabd5",
@fahmiegerton
fahmiegerton / sampledatatable.vue
Created December 19, 2021 04:24
This vuetify data table cause an error
<template>
<div>
<v-container>
<v-data-table :headers="headers" :items="dataku" class="elevation-1" item-key="id"> </v-data-table>
</v-container>
</div>
</template>
<script>
export default {
@fahmiegerton
fahmiegerton / MyController.php
Created October 4, 2021 16:30
Laravel Eloquent - Ignore mutators in some case situation (https://stackoverflow.com/a/43849449/4705820)
<?php
// ...
public function update(MyModel $m, $id) {
$m->$preventAttrSet = true; // this doesn't work, it will reset to false again
$data = $m->with('relation')->findOrFail($id)->ignoreMutators(); // this work and will ignore the mutators
return view('some.view', $data);
}
<script type="text/x-template" id="app-template">
<v-app>
<v-container>
<v-autocomplete
id="city"
name="city"
required
label="Your City"
v-model="form.city"
hide-no-data
@fahmiegerton
fahmiegerton / oracleflix.db
Created September 14, 2021 08:44
oracle final project
-- create tables --
-- create customer's table
CREATE TABLE customers(
customer_id NUMBER CONSTRAINT customer_id_pk PRIMARY KEY,
last_name VARCHAR2(25) NOT NULL,
first_name VARCHAR2(25) NOT NULL,
home_phone VARCHAR2(12) NOT NULL,
address VARCHAR2(100) NOT NULL,
city VARCHAR2(30) NOT NULL,
state VARCHAR2(2) NOT NULL,
@fahmiegerton
fahmiegerton / Request.php
Created March 30, 2021 18:28
CodeIgniter 4 to access request class for custom library. Maybe there's another nice way, but this is the only way I could think of.
<?php
namespace Library\CustomLibrary;
use CodeIgniter\HTTP\RequestInterface;
class Request
{
/**
* Instance of the main Request object.
*
@fahmiegerton
fahmiegerton / default.conf
Created March 8, 2021 02:33
Nuxt and PHP app under one domain [Nuxt => example.test, PHP =>example.test/api]. But it's not working, help!!
server {
## How to allow access from LAN and Internet to your local project:
## https://winnmp.wtriple.com/howtos#How-to-allow-access-from-LAN-and-Internet-to-your-local-project
listen 127.0.0.1:80;
## Enable self signed SSL certificate:
## https://winnmp.wtriple.com/howtos#Enable-self-signed-SSL-certificate-for-your-local-project
listen 127.0.0.1:443 ssl http2;
@fahmiegerton
fahmiegerton / Dockerfile
Created February 27, 2021 03:57
docker php-fpm alpine for codeigniter 4
# Image
FROM php:7.4.15-fpm-alpine3.12
# Set timezone
ENV TIMEZONE=Asia/Makassar
RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && echo $TIMEZONE > /etc/timezone
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && sync && install-php-extensions \
@fahmiegerton
fahmiegerton / modify.scss
Created February 26, 2021 08:13
Enable the valid/invalid bootstrap-vue border working with vee-validate 3
.form-control.v-select, .v-select * {
height: auto !important;
padding-right: 0px !important;
margin-right: 7px;
}
@fahmiegerton
fahmiegerton / db.js
Last active February 22, 2021 13:07
const sqlite3 = require('sqlite3').verbose();
var db;
var dberror = false;
const path = require('path');
async function buatDb() {
console.log("Sedang membuat db");
db = await new sqlite3.Database(path.resolve(__dirname, '../bin/dbsesi.db'), (err) => {
if (err) {
dberror = true;