Skip to content

Instantly share code, notes, and snippets.

View cyberfly's full-sized avatar

Muhammad Fathur Rahman cyberfly

View GitHub Profile
<?php
namespace App\Libraries;
class Lookup {
// constant for MAP NEGERI ID
// const MAP_JOHOR = "001";
// const MAP_KEDAH = "002";
public function store()
{
$rules = [
'title' => 'required',
'description' => 'required',
];
if (! $this->validate($rules)) {
return redirect()->back()->withInput();
}
<script type="module">
let data = {!! $keywords !!};
$('#example tbody').on('click', 'button', function () {
var data = table.row($(this).parents('tr')).data();
$("#keyword").val(data.keyword);
$("#keyword").focus();
});
@cyberfly
cyberfly / Layout.js
Last active September 14, 2022 07:50
const Layout = ({ children }) => {
useEffect(() => {
// set version
window.APP_VERSION = process.env.NEXT_PUBLIC_APP_VERSION;
}, []);
}
export default Layout;
@cyberfly
cyberfly / command.txt
Last active September 6, 2022 03:09
Now you can preview served project at http://localhost:8090
Host devserve
User akid
HostName 12.120.104.101
Port 41083
ForwardAgent yes
LocalForward 8090 localhost:8000
@cyberfly
cyberfly / .env
Last active September 1, 2022 02:05
NEXT_PUBLIC_HELPSCOUT_BEACON_ID=9dc0a553-237e-5678-1234-09977d96ddf8
import React, { useState, useEffect } from "react";
import Modal from "react-modal";
import { getModalStyle } from "helpers/common_helper";
export default function Home() {
const [modalIsOpen, setIsOpen] = useState(false);
// modal methods
function openModal() {
const nextConfig = {
trailingSlash: true,
images: {
loader: "akamai",
path: "",
},
};
module.exports = nextConfig;
cp -a /source/. /dest/
import React, { useState, useEffect } from "react";
const GenerateCounter = ({ count, updateCount, ...restProps }) => {
const handleClick = (e) => {
let new_count = count + 1;
updateCount(new_count);
};
return (