Skip to content

Instantly share code, notes, and snippets.

View satishbabariya's full-sized avatar

Satish Babariya satishbabariya

View GitHub Profile
@satishbabariya
satishbabariya / GridLayout.tsx
Created September 29, 2023 11:51
GridLayout
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import React, { useEffect, useMemo, useRef, useState } from "react";
import { mergeStyles, IStyle } from "@fluentui/merge-styles";
/**
* @private
*/
package main
import (
"embed"
"io/fs"
"net/http"
)
//go:embed public
var content embed.FS
@satishbabariya
satishbabariya / install-docker.sh
Last active March 24, 2022 14:32
Docker & Docker Compose Install Script
# Docker & Docker Compose will need to be installed on the machine
# curl -fsSL https://get.docker.com -o /tmp/get-docker.sh
# sh /tmp/get-docker.sh
# curl -L "https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# chmod 755 /usr/local/bin/docker-compose
# sudo systemctl enable docker
# sudo usermod -aG docker $USER
# sudo chmod 666 /var/run/docker.sock
@satishbabariya
satishbabariya / React Native Developer Roadmap.md
Last active January 22, 2024 05:18
React Native Developer Roadmap

Resty.js

Alt


SwiftyContacts

Alt

@satishbabariya
satishbabariya / main.go
Created December 7, 2021 11:44
supabase + gorush notification middleware service
package main
import (
"fmt"
"net/http"
"os"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/sirupsen/logrus"
package main
import (
"fmt"
"time"
"github.com/piquette/finance-go/quote"
)
func main() {
@satishbabariya
satishbabariya / supercharge api calls with codable and generics.md
Created October 17, 2021 14:34
supercharge api calls with codable and generics

supercharge api calls with codable and generics

Codeables and Generics are very powerful parts of Swift. They are pretty, simple, and very powerful!

If you aren't familiar with them, I encourage you to take a look! You can find detailed information about Generics and Codable here. [Generics]https://docs.swift.org/swift-book/LanguageGuide/Generics.html and [Codable]https://developer.apple.com/documentation/swift/codable

Take this example: you have to implement an API in your app. No big deal, right? Almost anybody can do that! Let me add the pod for Alamo... no, we're not taking that route, we're going to implement everything ourselves!

var supabase = SupabaseClient(supabaseUrl: "", supabaseKey: "")
supabase.auth.signIn(email: "sample@mail.com", password: "secret") { result in
switch result {
case let .success(session):
print(session)
case let .failure(error):
print(error.localizedDescription)
}
}
@satishbabariya
satishbabariya / rx.swift
Last active March 17, 2023 05:38
Simple RxSwift API Call
func getTodos() -> Observable<Any> {
// If No Internet Connection Throws error
// if Reachability()!.connection == .none {
// // !!!! return data form cache here
// return Observable.error(RESTError(message: "No internet connection.", type: .warning))
// }
return Observable.create { (observer) -> Disposable in