function creditCardCheck(num) {
var computed = makeComputed()
var i = (num + '').length
var start = false // why false? since double every the second index but start from right
var sum = 0
// start from right
while (i--) {
n = Number(num[i])
bitenow.1.mp4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [isTop, setIsTop] = useState(true) | |
useEffect(() => { | |
const handleScroll = () => { | |
setIsTop(window.scrollY < 100) | |
} | |
window.addEventListener('scroll', handleScroll) | |
return () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const [currentPosition, setCurrentPosition] = useState(0) | |
const [isScrollingToBottom, setIsScrollingToBottom] = useState(false) | |
useEffect(() => { | |
const handleScroll = () => { | |
const { scrollTop } = document.documentElement | |
const isScrollingDown = scrollTop > currentPosition | |
setIsScrollingToBottom(isScrollingDown) | |
setCurrentPosition(scrollTop) |
api response
{
"data": [
...
],
"links": {
"first": "https://example.com/pagination?page=1",
"last": "https://example.com/pagination?page=10",
kode ini harus di enchance. agar tidak terjadi case seperti ini lagi pada margin import tambahan
grade_mapping = {
"Mega Store": "mega",
"Basic Store": "basic",
"Super Store": "super",
}
This follow the lunar structure code.
First create folder call Pages
and Components
inside App\Http\Livewire
it will become something like this.
App\Http\Livewire\Components
App\Http\Livewire\Pages
Moving on. we will create new Page call Foo
- Create livewire component call
FooIndex
insidePages
Mix -> Vite
- install dependencies
vite
laravel-vite-plugin
vite-plugin-vue2
(for vue2.6)@vitejs/plugin-vue2
(for vue2.7) or@vitejs/plugin-vue
(for vue3)
for vue 2.7 https://github.com/vuejs/vue/blob/main/CHANGELOG.md#270-2022-07-01
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check whether quill content is empty | |
function isQuillEmpty(quill) { | |
if ((quill.getContents()['ops'] || []).length !== 1) { | |
return false | |
} | |
return quill.getText().trim().length === 0 | |
} | |
// Delta to HTML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Str; | |
function generateReferralCode($str) { | |
// get random number min & max 4 digit | |
$randomNumber = rand(1000, 9999); | |
// get the first 4 character and trim whitespace | |
$strName = trim(substr($str, 0, 4)); | |
// get str length |
NewerOlder