Skip to content

Instantly share code, notes, and snippets.

View katendeglory's full-sized avatar

Glory Katende katendeglory

View GitHub Profile
@katendeglory
katendeglory / Podcast.svelte
Created October 21, 2022 14:17
Scroll Snap
<script>
import Maintenance from "./Maintenance.svelte";
import PodcastCard from "./PodcastCard.svelte";
import SectionHeading from "./../utils/SectionHeading.svelte";
import Container from "./../utils/Container.svelte";
const books = [];
let scrollArea;
<script>
import { onMount } from "svelte";
import Container from "../utils/Container.svelte";
// let is_safari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
const playVideo = (id) => {
let vid = document.getElementById(id);
vid.src = "" /* Put a source here... */;
vid.preload = "auto"
/* --- */
/* ROUTE: webinars */
/* Multer Stuffs */
const uuid = require('uuid');
const cloudinary = require('cloudinary').v2;
const { CloudinaryStorage } = require('multer-storage-cloudinary');
const multer = require('multer');
@katendeglory
katendeglory / JSON All Countries with name, code, phone prefix and currencies.json
Last active July 21, 2021 10:25
JSON All Countries with name, code, phone prefix and currencies in JSON Format
{
"countries": [
{
"name": "Bangladesh",
"code": "BD",
"curr": "BDT",
"prefix": "+880"
},
{
"name": "Belgium",
<script>
import PostCard from "./components/PostCard.svelte";
import axios from "axios";
import { onMount } from "svelte";
// For some reasons import { inview } from "svelte-inview"; creates some issues
import { inview } from "svelte-inview/dist/index";
let posts = []; // The posts we'll fetch with axios
let page = 1; // We'll increment this when fetching more data
const PAGE_SIZE = 6; // The number of post we get per fetch
@katendeglory
katendeglory / tailwind-custom-file-upload.svelte
Created May 26, 2021 12:37
Tailwind custom file upload component
<label
for="watch-photos"
class="flex items-center"
style="display: flex !important;"
>
<ion-icon name="images" class="text-2xl mr-3" />
Upload Some Photos
</label>
{#if newWatch.photos}
@katendeglory
katendeglory / emoji-picker-tooltip.html
Created May 15, 2021 09:02
Emoji-picker tooltip example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>emoji-picker tooltip demo</title>
<style>
.tooltip:not(.shown) {
display: none;
}
</style>
<script>
import Resizer from "react-image-file-resizer";
import axios from "axios";
const resize = Resizer.imageFileResizer;
let rawImgs;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<script>
// The package that'll help us resize our images
import Resizer from "react-image-file-resizer";
// To post the resized images to your upload endpoint
import axios from "axios";
// We'll call this function later to resize images
const resize = Resizer.imageFileResizer;
@katendeglory
katendeglory / firebase-pagination.svelte
Last active May 3, 2023 18:09
Pagination for firestore queries
<script>
import { db, auth } from "./firebase";
let data = []; /* The actual array of data displayable to components */
let pageSize = 2;
let hasMore = true;
let query = db.collection("cities").orderBy("number");
let firstDoc;
let lastDoc;