Skip to content

Instantly share code, notes, and snippets.

View kanzitelli's full-sized avatar
💭
I may be slow to respond.

Batyr kanzitelli

💭
I may be slow to respond.
View GitHub Profile
@kanzitelli
kanzitelli / docker-compose.yml
Created September 13, 2019 16:10
Docker Compose file for Traefik v2.0 deployed on Digital Ocean with https available
version: '3'
services:
reverse-proxy:
image: traefik:v2.0
restart: always
container_name: traefik
command:
- "--api=true"
- "--providers.docker=true"
@kanzitelli
kanzitelli / docker-compose.yml
Last active March 3, 2024 20:35
Deploying PostgreSQL and Redis behind Traefik in the Cloud
version: "3.7"
services:
proxy:
image: traefik:latest
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
# Endpoints setup
@kanzitelli
kanzitelli / React-Native-WebView-Cookies.js
Last active June 27, 2023 08:30
React Native Trick: Get Cookies of WebView without using any native modules such as react-native-cookies. Might be helpful for getting JWT while making OAuth2 👽
// @flow
import React, { Component } from 'react';
import {
WebView,
} from 'react-native';
class LoginScreen extends Component {
state = {
cookies : {},
@kanzitelli
kanzitelli / traefik-2-postgres-redis.docker-compose.yml
Created August 4, 2021 13:23
Running Postgres & Redis behind Traefik (using TCP)
version: "3.7"
services:
proxy:
image: traefik:v2.3
container_name: server_proxy
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
@kanzitelli
kanzitelli / docker-compose.yml
Created September 12, 2019 18:31
Docker Compose file with Traefik, Backend and MongoDB configured. For running locally.
version: '3'
services:
reverse-proxy:
image: traefik:v2.0
container_name: traefik
command: --api --providers.docker
ports:
- "6969:80"
- "6970:8080"
@kanzitelli
kanzitelli / react-native-track-player+2.1.2.patch
Created December 10, 2021 19:22
Patch file for react-native-track-player to work with exoplayer 2.13.2
diff --git a/node_modules/react-native-track-player/android/build.gradle b/node_modules/react-native-track-player/android/build.gradle
index a241d94..48138f9 100644
--- a/node_modules/react-native-track-player/android/build.gradle
+++ b/node_modules/react-native-track-player/android/build.gradle
@@ -60,7 +60,7 @@ dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+'
- def exoPlayerVersion = safeExtGet("exoPlayerVersion", '2.11.4')
+ def exoPlayerVersion = safeExtGet("exoPlayerVersion", '2.13.2')
@kanzitelli
kanzitelli / getAll-supabase.ts
Last active December 7, 2021 20:51
Get more than 1000 records from Supabase database in one function
const N = 500;
const getAll = async (prefix: string): Promise<T[]> => {
const allData: T[] = [];
let dataLen = 0;
let i = 1;
do {
const { data, error } = await supabase
.from('table')
@kanzitelli
kanzitelli / @react-native-community+blur+3.6.0.patch
Created August 22, 2021 19:10
Patch file for @react-native-community/blur to work with RN 0.65.+
diff --git a/node_modules/@react-native-community/blur/android/build.gradle b/node_modules/@react-native-community/blur/android/build.gradle
index 8177235..5d310b9 100644
--- a/node_modules/@react-native-community/blur/android/build.gradle
+++ b/node_modules/@react-native-community/blur/android/build.gradle
@@ -9,7 +9,6 @@ buildscript {
if (project == rootProject) {
repositories {
google()
- jcenter()
}
@kanzitelli
kanzitelli / react-native-navigation-tab-indicator-example.tsx
Last active August 18, 2021 14:46
React Native Navigation (v7.18.1) Tab Indicator Example
// The purpose of this gist is to give an idea of how to implement tab indicator functionality using react-native-navigation
// This example is based on rnn-starter (https://github.com/kanzitelli/rnn-starter)
import { Navigation, LayoutComponent } from 'react-native-navigation';
import merge from 'lodash/merge';
// types
type TabScreen = 'Home' | 'Explore' | 'Account';
type TabScreenInfo = {
name: TabScreen;
@kanzitelli
kanzitelli / Large-Title-with-Screen-on-2+-Tab.tsx
Last active November 20, 2020 13:30
React Native Navigation Hacks - Large Title with ScrollView hacks and Large Title issue with a screen on 2+ tab. For iOS only.
/*
The basic idea here is to have the whole content hidden so the navigation bar will become large
and once our screen triggers componentDidAppear() (it didn't work with useEffect()),
we show the content and the navigation bar remains large and acts as expected.
*/
import { useNavigationComponentDidAppear } from 'react-native-navigation-hooks/dist/hooks';
const SomeScreen: NavigationFunctionComponent = ({
componentId,