Skip to content

Instantly share code, notes, and snippets.

View ibnuhalimm's full-sized avatar
😃
Be Grateful

IBNU HALIM MUSTOFA ibnuhalimm

😃
Be Grateful
View GitHub Profile
@ibnuhalimm
ibnuhalimm / README.md
Last active August 18, 2022 00:31
Vim / Neovim Setup

How to Setup Neovim on Linux

  1. Install Neovim >> Neovim Docs

  2. Install Vim Plug >> Vim Plug Repository

  3. Copy-paste the following init.vim to ~/.config/nvim/init.vim

  4. Create a directory ~/.cache/vim_gutentags

@ibnuhalimm
ibnuhalimm / Restore Mysql Database to Docker Container
Last active August 4, 2021 06:40
Restore Mysql Database to Docker Container
1. Copy the .sql file
`docker cp /path/to/file.sql container_name:/copied_file.sql`
2. Remote the container
`docker exec -it container_name bash`
3. Import the database
`mysql -u username -p dbname < copied_file.sql`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./css/tailwind.css">
</head>
<body>
@ibnuhalimm
ibnuhalimm / search-bar.js
Created April 14, 2021 03:10
Frontend Fundamental 01
class SearchBar extends HTMLElement {
connectedCallback() {
this.render();
}
set clickEvent(event) {
this._clickEvent = event;
this.render();
}
@ibnuhalimm
ibnuhalimm / valet.conf
Created October 2, 2020 01:38 — forked from poul-kg/valet.conf
CORS Rules for Laravel Valet Nginx
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
#!/bin/bash
#######################################
# Variables #
# source : https://askubuntu.com/questions/865792/how-can-i-monitor-the-tbw-on-my-samsung-ssd
#######################################
SSD_DEVICE="/dev/sda"
ON_TIME_TAG="Power_On_Hours"
$('#__formAddMenu').submit(function() {
var checked_nodes = [];
checked_nodes = $('#__containerMenu').jstree('get_checked');
$("#__containerMenu").find(".jstree-undetermined").each(
function(i, element) {
checked_nodes.push( $(element).closest('.jstree-node').attr("id") );
}
);
var ajaxReturn;
var ajaxAction = function(type, url, data, submitText) {
if(typeof(data) == 'object')
{
$.ajax({
type: type,
url: base_ajax+'/'+url,
data: data,
async: false,
$min-phone: 320px;
$med-phone: 480px;
$med-phone-1: 481px;
$max-phone: 767px;
$min-tablet: 768px;
$max-tablet: 991px;
$min-desktop: 992px;
$med-desktop: 1200px;
@ibnuhalimm
ibnuhalimm / dump_script.sh
Last active April 17, 2019 15:21
Dumping All Database to Separate Files
#!/bin/bash
## Create 'backup' mysql user
# CREATE USER 'backup'@'localhost' IDENTIFIED BY 's3cr3t';
# GRANT EVENT, LOCK TABLES, PROCESS, REFERENCES, SELECT, SHOW DATABASES, SHOW VIEW, TRIGGER ON *.* TO 'backup'@'localhost' ;
USER="backup"
PASSWORD="backup_pwd"
OUTPUTDIR=$(dirname $0)"/databases"
MYSQLDUMP="/usr/bin/mysqldump"