Skip to content

Instantly share code, notes, and snippets.

View ratul16's full-sized avatar
🎯
Focusing

Hasibul Alam Ratul ratul16

🎯
Focusing
View GitHub Profile
# ~/.config/starship.toml
[battery]
full_symbol = "🔋"
charging_symbol = "🔌"
discharging_symbol = "⚡"
[[battery.display]]
threshold = 30
style = "bold red"
@ratul16
ratul16 / .eslintrc.js
Last active August 26, 2021 18:48
Eslint config
module.exports = {
root: true,
env: {
node: true,
browser: true
},
extends: [
"plugin:vue/recommended",
"eslint:recommended",
"prettier/vue",
@ratul16
ratul16 / gist:c8b1b5a45b1967b974fb507ed02409fa
Created July 8, 2021 15:21
Empty array check #FoolProof Method
if (!Array.isArray(data) || !data.length) {
this.not_found = true;
console.log('empty');
} else {
this.addresses = response.data.result;
}
@ratul16
ratul16 / Circle Image with css
Last active April 29, 2021 17:05
All Size Image circle maker with css only
img {
object-fit: cover;
width: 180px;
height: 180px;
border-radius: 50%;
}
@ratul16
ratul16 / copyToclipboard.vue
Last active September 9, 2024 07:15
Social share button and copyToclipboard with nuxt js
<template>
<v-card id="create">
<v-speed-dial
v-model="fab"
:top="top"
:bottom="bottom"
:right="right"
:left="left"
:direction="direction"
:open-on-hover="hover"
@ratul16
ratul16 / sendEmail.js
Last active April 6, 2022 05:50
Email js Function for Vue js
sendEmail() {
emailjs
.send(
"<SERVICE_ID>",
"<TEMPLATE_ID>",
{
subject: this.subject,
user_name: this.name,
user_email: this.email,
message: this.message,
@ratul16
ratul16 / readTime.js
Last active April 6, 2022 05:51
Medium like read time indicator
readTime() {
var minutes = 0;
const contentText = JSON.stringify(this.page);
const words = contentText.split(' ').length;
const wordsPerMinute = 200;
minutes = Math.ceil(words / wordsPerMinute);
console.log(minutes);
return minutes;
},
let url = window.location.href
let arr = url.split("/");
console.log(arr)
// Input Field formatter
function seprator(input) {
let nums = input.value.replace(/,/g, '');
if(!nums || nums.endsWith('.')) return;
input.value = parseFloat(nums).toLocaleString();
}
<input type="text" id="inputSep" oninput="seprator(this)" placeholder="123,456,789"/>
// Formatter function
@ratul16
ratul16 / docker-help.md
Created October 15, 2020 04:01 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info