Skip to content

Instantly share code, notes, and snippets.

View Minishlink's full-sized avatar

Louis Lagrange Minishlink

View GitHub Profile
@Minishlink
Minishlink / react-native-jw-media-player+0.1.46.patch
Created August 21, 2020 05:23
Patch for react-native-jw-media-player 0.1.46 and Android SDK 3.16 breaking change
diff --git a/node_modules/react-native-jw-media-player/android/build.gradle b/node_modules/react-native-jw-media-player/android/build.gradle
index 1db78a8..a0d8510 100644
--- a/node_modules/react-native-jw-media-player/android/build.gradle
+++ b/node_modules/react-native-jw-media-player/android/build.gradle
@@ -45,8 +45,9 @@ allprojects {
dependencies {
implementation 'com.facebook.react:react-native:+'
- implementation 'com.longtailvideo.jwplayer:jwplayer-core:+'
- implementation 'com.longtailvideo.jwplayer:jwplayer-common:+'
@Minishlink
Minishlink / react-native-snackbar+2.2.3.patch
Created August 12, 2020 03:43
react-native-snackbar for showing snackbar even when modal will disappear (eg loading overlay)
diff --git a/node_modules/react-native-snackbar/android/src/main/java/com/azendoo/reactnativesnackbar/SnackbarModule.java b/node_modules/react-native-snackbar/android/src/main/java/com/azendoo/reactnativesnackbar/SnackbarModule.java
index 0a405fb..c21c5b4 100644
--- a/node_modules/react-native-snackbar/android/src/main/java/com/azendoo/reactnativesnackbar/SnackbarModule.java
+++ b/node_modules/react-native-snackbar/android/src/main/java/com/azendoo/reactnativesnackbar/SnackbarModule.java
@@ -62,9 +62,11 @@ public class SnackbarModule extends ReactContextBaseJavaModule {
mActiveSnackbars.clear();
+ boolean shouldForceDisplayOnMainView = getOptionValue(options, "shouldForceDisplayOnMainView", false);
+

This fixes some work that is not yet synchronised between cli/metro and RN.

As you can see this only works for all platforms if you manually replace the assets URL in metro.config.js. So if you have more assets that are affected by this bug, add them in metro.config.js.

Adjust to your folder structure, mine is:

  • apps
    • app-1
      • metro.config.js
  • ...
@Minishlink
Minishlink / MainActivity.java
Created August 1, 2019 08:18
RootBeer example
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this);
if (!BuildConfig.DEBUG && !BuildConfig.SKIP_ROOT_CHECK) {
RootBeer rootBeer = new RootBeer(this);
if (rootBeer.isRootedWithoutBusyBoxCheck()) { // isRooted has false positives (OnePlus devices and MotoE)
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("You cannot use this app on a rooted device.")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Minishlink
Minishlink / config.yml
Created July 16, 2019 15:06
React Native circleci config
version: 2
jobs:
build:
docker:
- image: circleci/node:10
environment:
TZ: '/usr/share/zoneinfo/Europe/Paris'
working_directory: ~/app

Keybase proof

I hereby claim:

  • I am minishlink on github.
  • I am minishlink (https://keybase.io/minishlink) on keybase.
  • I have a public key ASBnl6ZrwZQsP7Vpe0da4ARfzMzjVl224bjP4Yk5lshR5wo

To claim this, I am signing this object:

@Minishlink
Minishlink / webpack.config.babel.js
Created October 5, 2017 18:04
webpack config for RN Web
//import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; if you want to analyze size
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const isDev = process.env.NODE_ENV !== 'production';
const everythingExceptNodeModulesLoader = {
test: /\.js$/,
exclude: /node_modules/,
use: {
@Minishlink
Minishlink / .zshrc
Last active January 28, 2023 19:59
Cool aliases
eval "$(fnm env --use-on-cd)"
export PATH="$PATH:$(yarn global bin)"
export PATH="$PATH:/Users/louislagrange/.local/bin"
export PATH="$PATH:$(brew --prefix)/opt/python/libexec/bin"
export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
alias gtp="cd $HOME/Projets"
alias kill_sound="sudo kill -9 $(ps aux | grep -e '^_coreaudiod.*/usr/sbin/coreaudiod$' | awk '{print $2}')"