Skip to content

Instantly share code, notes, and snippets.

View autotrof's full-sized avatar
🏠
WFH

Agung Kurniawan autotrof

🏠
WFH
View GitHub Profile
@autotrof
autotrof / crontab
Last active May 5, 2024 16:31
docker for laravel full
* * * * * cd /var/www/html && php artisan schedule:run >> /dev/null 2>&1
@autotrof
autotrof / Dockerfile
Created March 10, 2024 23:54
docker web with nodejs. php 7.3, nginx, nodejs 10, yarn, etc
FROM webdevops/php-nginx:7.3
RUN apt update
RUN apt install curl procps nano -y
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y nodejs
RUN npm i -g yarn
WORKDIR /app
@autotrof
autotrof / init-script.sh
Last active August 10, 2023 09:50
install dependencies for web developer in code-server container
apt update -y
apt upgrade -y
apt install nvm ncdu htop default-mysql-client git -y
nvm install --lts && npm i -g nodemon yarn pm2 forever
apt install software-properties-common -y
add-apt-repository ppa:ondrej/php -y
apt update -y
apt install php8.2 php8.2-fpm php8.2-mysql php8.2-mbstring php8.2-xml php8.2-gd php8.2-curl -y
apt install php7.4 php7.4-fpm php7.4-mysql php7.4-mbstring php7.4-xml php7.4-gd php7.4-curl php7.4-json -y
apt upgrade
@autotrof
autotrof / enableVueDevTools.js
Created July 23, 2023 01:43
force enable vue dev-tools in
// source : https://mokkapps.de/vue-tips/force-enable-vue-devtools-in-production-build
const enableDevTools = () => {
const app = Array.from(document.querySelectorAll('*')).find((e) => e.__vue__).__vue__
const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__
devtools.enabled = true
let Vue = Object.getPrototypeOf(app).constructor
while (Vue.super) {
Vue = Vue.super
@autotrof
autotrof / waitForElm.js
Created July 22, 2023 09:55
javascript wait for elm
// https://stackoverflow.com/a/61511955
function waitForElm(selector) {
return new Promise(resolve => {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
}
const observer = new MutationObserver(mutations => {
if (document.querySelector(selector)) {
@autotrof
autotrof / Dockerfile
Last active June 29, 2023 23:54
docker for laravel project
FROM webdevops/php-nginx:8.2
LABEL maintainer upload.kurniawan@gmail.com
RUN apt update
RUN apt install nano wget curl -y
RUN touch ~/.bashrc && chmod +x ~/.bashrc
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
RUN mv /bin/sh /bin/sh.bak && ln -s /bin/bash /bin/sh
RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm install --lts
<script>
export default{
props:{
url:{
type:String,
required:true
},
value:{
type:Object,
default:{
<script>
import axios from 'axios'
export default{
props:{
listPerPage:{
type:Array,
default:()=>[10,25,50]
},
perPage:{
type:Number,
<template>
<div ref="modal_wrapper" class="modal_wrapper w-0 h-0 fixed z-50 inset-0 overflow-y-auto opacity-0" aria-labelledby="modal-title" role="dialog" aria-modal="true">
<div ref="modal_content" class="modal_content items-end justify-center text-center sm:block sm:p-0 flex pb-10 relative top-32">
<div ref="modal_backdrop" :class="{'opacity-0 w-0 h-0':!opened,'w-full h-full opacity-100':opened}" v-on:click="close()" class="modal_backdrop fixed inset-0 bg-gray-800 bg-opacity-75 transition-opacity" aria-hidden="true"></div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">&#8203;</span>
<div ref="modal_body" :class="{'opacity-100 translate-y-0 sm:scale-100':opened,'opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95':!opened}" class="modal_body relative inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full ease-in-out duration-200">
<slot name=
@autotrof
autotrof / tailwind modal html jquery
Created March 24, 2022 09:49
contoh tailwind & jquery menampilkan modal
<style>
.modal-wrapper{
@apply z-10 inset-0 overflow-y-auto opacity-0;
}
.modal-wrapper:not(.open){
@apply w-0 h-0 absolute;
}
.modal-wrapper.open{