Skip to content

Instantly share code, notes, and snippets.

View bogordesaincom's full-sized avatar
Coffee at the Morning

Iman Sugirman bogordesaincom

Coffee at the Morning
View GitHub Profile
{
"flightId": "3CgbWE8IWKZ+gnQ0cDFUPt5kFvsTxXQf/Vm7GopIqrumJ6ePbfJ+Y4e6AG7nW8vj8gKS1xons+IfK2wSLPxuXV7P8Rjwg8XOI8Eah54nPMbZ9nar0aKcRW4vJqkVUZoYevyZzXJ5Uj9awP/rE7x8mM5DDzdcfqAIwXegbVJ0Ho1PC1CMcKpSwYXlhE3wxDkIx+bPMxOyK8KKZ+XNBANL7xU+6GqjbSD9lv6wvYnS8uU=",
"departureAirport": "CGK",
"arrivalAirport": "DPS",
"numOfTransits": "0",
"journeys": [
{
"segments": [
{
"flightCode": "QZ-810",
/* eslint-disable react/display-name */
import { Button, Checkbox, Grid, LoadingOverlay, Modal } from '@mantine/core';
import { useForm, zodResolver } from '@mantine/form';
import { showNotification } from '@mantine/notifications';
import { IconCheck, IconX } from '@tabler/icons-react';
import { useImperativeHandle, useState, forwardRef } from 'react';
import { z } from 'zod';
import Permission from '@easytool/react-permission';
import PermissionDeniedModal from '@/components/Extra/PermissionDeniedModal';
import useTranslation from 'next-translate/useTranslation';
@bogordesaincom
bogordesaincom / UseHandler.js
Created December 29, 2023 00:32
Hono Sample Upload using Middleware
import upload from "../lib/upload";
// const UPLOADS_DIR = "./public";
// const indexUser = async (c) => {
// return c.json({ message: "User Index" });
// };
const storeUser = async (c) => {
const body = await c.req.parseBody();
@bogordesaincom
bogordesaincom / Dockerfile
Created November 8, 2023 03:15
Couch DB Fly
FROM couchdb:latest
COPY local.ini /opt/couchdb/etc/
@bogordesaincom
bogordesaincom / local.ini
Last active November 7, 2023 17:16
Couch
; CouchDB Configuration Settings
; Custom settings should be made in this file. They will override settings
; in default.ini, but unlike changes made to default.ini, this file won't be
; overwritten on server upgrade.
[chttpd]
bind_address = "0.0.0.0"
[httpd]
@bogordesaincom
bogordesaincom / getPermission.js
Created October 8, 2023 14:20
Drizzle Role to Permissions
const getUserDataWithPermission = async (res, token) => {
const permissionList = await db.transaction(async (tx) => {
const roleName = await tx.query.role.findFirst({ where: eq(role.id, getUserRoleID) });
if (!roleName) {
return res.status(401).json({ message: 'User Not Role' });
}
const rolePermissions = await tx.query.role_permission.findMany({
@bogordesaincom
bogordesaincom / backup.yml
Created July 31, 2023 02:29 — forked from mfilej/backup.yml
Back up a Fly.io Postgres database to S3 using GitHub Actions
name: Back up database
run-name: Task
on:
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
jobs:
backup:
runs-on: ubuntu-latest
env:
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
# server_tokens off;
@bogordesaincom
bogordesaincom / function.php
Last active March 7, 2023 07:09
Helper theme
<?php
// Add custom Theme Functions here
// $myrows = $wpdb->get_results( "SELECT ID, post_name FROM {$wpdb->prefix}posts" );
// $results = $wpdb->get_results( "SELECT id FROM {$wpdb->prefix}frm_items", OBJECT );
// $latestID = $wpdb->get_var( 'SELECT id FROM ' . $wpdb->prefix . 'frm_items' . ' ORDER BY id DESC LIMIT 1');
// print_r((int)$latestID);
function custom_css() {
@bogordesaincom
bogordesaincom / nginx.conf
Created February 17, 2023 02:25
Nginx Wp
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
# multi_accept on;
}