Skip to content

Instantly share code, notes, and snippets.

View cyberfly's full-sized avatar

Muhammad Fathur Rahman cyberfly

View GitHub Profile
@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 (
<div id="apiusers_list" _="on htmx:beforeSwap call disposeTooltip() on htmx:afterSwap call handleTableDomUpdated()"
class="content-block overflow-hidden">
{% include 'drafu/partial/_list_apiusers.html' %}
</div>
<div id="modal_container" _="on htmx:afterSwap call handleModalDomUpdated()"></div>
<form hx-post="{% url 'drafu:apiuser-list' %}" hx-target="#apiusers_list"
_="on htmx:responseError call swapBodyError()">
document.querySelector('.btn-create').addEventListener('click', function (e) {
getModalContent(e, this);
});
// test
var edit_modal_btn_list = document.querySelectorAll('.btn-edit');
edit_modal_btn_list.forEach(function (edit_btn, index) {
edit_btn.addEventListener('click', function (e) {
git rm --cached <file>