Skip to content

Instantly share code, notes, and snippets.

View kesha-antonov's full-sized avatar
🏆
Working on great apps

Kesha Antonov kesha-antonov

🏆
Working on great apps
View GitHub Profile
@satya164
satya164 / patch.diff
Last active November 8, 2023 16:36
Android Gradle Plugin 8 support for React Native libraries
diff --git a/android/build.gradle b/android/build.gradle
index 525cb31..6af104d 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -36,7 +36,30 @@ def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["MyLib_" + name]).toInteger()
}
+def supportsNamespace() {
+ def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
@ecklf
ecklf / useStatusBarHeight.ts
Last active April 9, 2024 17:13
Determine the current status bar height. This is useful to determine keyboardVerticalOffset for KeyboardAvoidingView, since iPhone X and newer use different dimensions.
import { useEffect, useState } from "react";
import {
NativeEventEmitter,
NativeModules,
Platform,
StatusBar,
} from "react-native";
const { StatusBarManager } = NativeModules;
#import <UIKit/UIKit.h>
#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
#import <React/RCTBridgeDelegate.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
@property (nonatomic, strong) UMModuleRegistryAdapter *moduleRegistryAdapter;
@property (nonatomic, strong) UIWindow *window;
@end
platform :ios, '10.0'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
# don't just copy and paste this, notice that the target names should align with what is already in your Podfile
target 'YourAppNameHere' do
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',
'DevSupport',
# When using RN in combination with Cocoapods, a lot of
# things are broken. These are the fixes we had to append
# to our Podfile when upgrading to ReactNative@0.55.3.
#
# WARNING: Check those line numbers when you're on a different version!
def change_lines_in_file(file_path, &change)
print "Fixing #{file_path}...\n"
contents = []
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@trustedtomato
trustedtomato / wait-frame.js
Created August 31, 2017 09:23
requestAnimationFrame Promise
const waitFrame = () => new Promise(requestAnimationFrame);
@ptmt
ptmt / rn-cli.config.js
Last active March 8, 2020 16:21
rn-cli.config.js
const path = require('path');
// Don't forget to everything listed here to `package.json`
// modulePathIgnorePatterns.
const sharedBlacklist = [
/node_modules[/\\]react[/\\]dist[/\\].*/,
'downstream/core/invariant.js',
/website\/node_modules\/.*/,
@heron2014
heron2014 / react-native-maps-enable-google-maps-instructions.md
Last active April 11, 2024 09:39
Visual instructions how to enable Google Maps on IOS using react-native-maps

Visual instructions how to enable Google Maps on IOS using react-native-maps

UPDATE: Following instructions are now a year old. I have recently managed to upgrade react-native-maps from 0.17 to the latest version 0.21 with react-native 0.51 - if you want to follow my instruction scroll down to the end this doc! Hope that will work for you too!

This is for my personal use, things might not be correctly explained here. For the official docs please check https://github.com/airbnb/react-native-maps

Steps from scratch:

1.react-native init GoogleMapPlayground

@woffleloffle
woffleloffle / parser.js
Created October 29, 2016 08:04
Parse multipart/form-data in JavaScript
/**
* This parses multipart/form-data when passed into a Lambda function through
* API Gateway using the following Integration Request Mapping Template:
#set($allParams = $input.params())
{
"body" : $input.json('$'),
"params" : {
#foreach($type in $allParams.keySet())
#set($params = $allParams.get($type))