Skip to content

Instantly share code, notes, and snippets.

View mrousavy's full-sized avatar
🐍
slime season

Marc Rousavy mrousavy

🐍
slime season
View GitHub Profile
@mrousavy
mrousavy / Discovery.cs
Created November 11, 2017 18:07
C#: Brutal network discovery on a web port
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Reactive.Linq;
using System.Threading;
using System.Threading.Tasks;
@mrousavy
mrousavy / cloudSettings
Last active June 14, 2020 13:03
My Visual Studio Code Synced settings
{"lastUpload":"2020-06-14T13:03:34.770Z","extensionVersion":"v3.4.3"}
@mrousavy
mrousavy / README.md
Last active June 28, 2018 17:17
Useful GitHub README tricks or templates
README.md

Some library

Buy Me a Coffee at ko-fi.com

@mrousavy
mrousavy / ProcessExtensions.cs
Created May 21, 2019 12:49
Process Extension to read environment variables of a process
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
namespace GameFinder
{
@mrousavy
mrousavy / banner.png
Last active August 18, 2022 11:51
My Portfolio in Markdown
banner.png
@mrousavy
mrousavy / react-navigation-shared-element-v5-guide.md
Last active June 12, 2022 12:56
React Navigation Shared Element v5 Guide

How to use React Navigation Shared Element v5

Install

Run:

npm i react-navigation-shared-element@next react-native-shared-element
npm i @react-navigation/native@^5.0.9 @react-navigation/stack@^5.1.1
@mrousavy
mrousavy / react-native-screens+2.7.0.patch
Created May 12, 2020 14:53
react-native-screens Native Stack Navigator Android Translucent StatusBar inset patch
diff --git a/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.java b/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.java
index a9779ad..36726d6 100644
--- a/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.java
+++ b/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.java
@@ -3,6 +3,7 @@ package com.swmansion.rnscreens;
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
+import android.os.Build;
import android.text.TextUtils;
@mrousavy
mrousavy / useDebouncedEffect.ts
Created June 30, 2020 12:29
A React hook similar to useEffect, but with a custom timeout to debounce an extra function, for example fetch data from a server when the text changes.
import { useEffect, useRef } from 'react';
/**
* Like useEffect but with a custom timeout to debounce an extra function, for example fetch data from a server when the text changes.
* @param shouldExecuteDebounce A function (created with `useCallback`!) which checks whether the `debounceExecute` function should be executed (after it's debounce delay).
* @param debouncedExecute A function (created with `useCallback`!) to run after `{debounceMs}` milliseconds. This function only gets executed, when this hook doesn't re-run within `{debounceMs}` milliseconds after the execution of the `alwaysExecute` function. Note: Because of it's async nature, this function cannot return a cleanup function.
* @param debounceMs The milliseconds to wait until the debounce function gets executed
* @example
* useDebouncedEffect(
* useCallback(() => {
@mrousavy
mrousavy / react-native+0.63.0.patch
Last active January 29, 2022 04:14
react-native 0.63 patch for iOS 13 Modal's onRequestClose (Swipe down gesture)
diff --git a/node_modules/react-native/React/Views/RCTModalHostView.h b/node_modules/react-native/React/Views/RCTModalHostView.h
index 4e61886..2b8b6c0 100644
--- a/node_modules/react-native/React/Views/RCTModalHostView.h
+++ b/node_modules/react-native/React/Views/RCTModalHostView.h
@@ -17,7 +17,7 @@
@protocol RCTModalHostViewInteractor;
-@interface RCTModalHostView : UIView <RCTInvalidating>
+@interface RCTModalHostView : UIView <RCTInvalidating, UIAdaptivePresentationControllerDelegate>