Skip to content

Instantly share code, notes, and snippets.

View nidhi-canopas's full-sized avatar

nidhi-canopas

View GitHub Profile
<template>
<swiper
:slides-per-view="4"
:space-between="30"
@swiper="onSwiper"
@slideChange="onSlideChange"
class="default-slider"
>
<swiper-slide v-for="n in 7" :key="n"> {{ n }} </swiper-slide>
</swiper>
<template>
<swiper :slides-per-view="1" :navigation="true">
<swiper-slide v-for="n in 7" :key="n"> {{ n }} </swiper-slide>
</swiper>
</template>
<style scoped>
.swiper-slide {
display: flex;
height: 300px;
<template>
<div class="swiper-pagination"></div>
<swiper
:slides-per-view="1"
:pagination="pagination"
class="pagination-slider"
>
<swiper-slide v-for="n in 7" :key="n"> {{ n }} </swiper-slide>
</swiper>
</template>
<template>
<swiper :effect="'cards'" :grabCursor="true">
<swiper-slide v-for="n in 7" :key="n"> {{ n }} </swiper-slide>
</swiper>
</template>
<script>
// Import Swiper Vue.js components
import { Swiper } from "swiper/vue/swiper";
<template>
<swiper
:effect="'coverflow'"
:grabCursor="true"
:centeredSlides="true"
:slidesPerView="'auto'"
:coverflowEffect="{
rotate: 50,
stretch: 0,
depth: 100,
<template>
<swiper
:direction="'vertical'"
:slidesPerView="1"
:spaceBetween="50"
:mousewheel="true"
:pagination="{
clickable: true,
}"
class="mousewheel-slider"
<template>
<div>
<swiper
@swiper="setSwiperRef"
:slidesPerView="5"
:spaceBetween="30"
:centeredSlides="true"
:pagination="{
type: 'fraction',
}"
@nidhi-canopas
nidhi-canopas / utility_functions.go
Last active November 11, 2022 02:27
A bunch of commonly used function with slice, string and time using Golang
package main
import (
"fmt"
"math/rand"
"regexp"
"strconv"
"strings"
"time"
)
import "fmt"
func main() {
// create an array of strings
slice := []string{"apple", "grapes", "mango"}
// You can check by changing element to "orange"
if Contains(slice, "mango") {
fmt.Println("Slice contains element")
} else {
fmt.Println("Slice doesn't contain element")
import (
"time"
"fmt"
)
func main() {
currentTime := time.Now()
// Time after 18 hours of currentTime
futureTime := time.Now().Add(time.Hour * 18)
// Time after 10 hours of currentTime