Skip to content

Instantly share code, notes, and snippets.

View rwaddin's full-sized avatar
🖥️
Freelance Full-stack web developer

addin rwaddin

🖥️
Freelance Full-stack web developer
View GitHub Profile
@rwaddin
rwaddin / index.js
Created August 24, 2022 02:01
for medium tutorial
const routes = [
{
path: "/",
redirect: "/dashboard",
component: () => import("../views/themes/dashboard"),
meta:{
requiresAuth: true
}
]
@rwaddin
rwaddin / index.html
Created August 4, 2022 13:45
Bottom navbar with bootstrap 4
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bottom Navbar Bootstrap</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<style type="text/css">
svg{
color: white;
@rwaddin
rwaddin / generate-2fa-whmcs.php
Last active January 11, 2022 03:04
this script for generate code to tblclients field authdata. for verify token 2 FA whmcs. This is not clean code just example base on sistem verify whmcs.
<?php
$kd_manual = createBase32Key();
$tokenkey = helperb322hex($kd_manual);
$qrcode = helperhex2b32($tokenkey);
$backupcode = "123456789012345";
$init = [
"tokenkey" => $tokenkey,
"tokentype" => "TOTP",
@rwaddin
rwaddin / shell.txt
Created November 4, 2021 05:21
Error: Let's Encrypt validation status 400
v-add-letsencrypt-domain [username] [domainname.com]
// change [username] with your name of user
// change [domainname.com] with domain what you want to add ssl
@rwaddin
rwaddin / index.html
Created April 28, 2021 05:49
Scroll to element inside div jQuery
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="main.js"></script>
<link href="style.css">
<div class="left">
<div class="js_scrollTo">test1</div>
<div class="js_scrollTo">test2</div>
<div class="js_scrollTo">test3</div>
</div>
<div class="right">
@rwaddin
rwaddin / component.js
Last active April 28, 2021 04:40
Listen change state vuex vue.js 2
// i am use ext .js because if i use .vue doesn't higlihgt
computed: {
listenSelectMessage() {
return this.$store.state.staffChat._searchMessage.selected;
},
},
watch:{
listenSelectMessage: function (baru, lama) {
console.log(baru, lama)
// event here
@rwaddin
rwaddin / index.php
Created April 6, 2021 09:08
Solve CORS Origin :: My case in vue.js 2 with axios and rest api codeigniter 3.1.11
<?php
// please place this script to index.php in root folder
// in first line after open tag php
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS");
header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method,Access-Control-Request-Headers, Authorization");
if ($_SERVER['REQUEST_METHOD'] == "OPTIONS") {
header("HTTP/1.1 200 OK");
die();
@rwaddin
rwaddin / receive-data.js
Created April 5, 2021 06:22
Communication parent and child iframe
window.addEventListener('message', function(e) {
// Get the sent data
const data = e.data;
// If you encode the message in JSON before sending them,
// then decode here
// const decoded = JSON.parse(data);
});
@rwaddin
rwaddin / index.html
Last active March 24, 2021 01:34
Loop each jQuery
<!DOCTYPE html>
<html>
<head>
<title>Loop each jQuery</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<select multiple id="hari">
<option value="Senin">Senin</option>
@rwaddin
rwaddin / index.html
Created March 19, 2021 09:25
Rating start 1 to 5 native css
<div class="rating">
<input type="radio" name="rating" value="5" id="5"><label for="5">☆</label>
<input type="radio" name="rating" value="4" id="4"><label for="4">☆</label>
<input type="radio" name="rating" value="3" id="3"><label for="3">☆</label>
<input type="radio" name="rating" value="2" id="2"><label for="2">☆</label>
<input type="radio" name="rating" value="1" id="1"><label for="1">☆</label>
</div>