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 / 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 / banner.png
Last active August 18, 2022 11:51
My Portfolio in Markdown
banner.png
@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 / 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 / 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 / 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 / file_io.h
Created November 11, 2017 17:58
C++ filestream Input/Output functions for numbers (32bit, 16bit and 8bit reading and writing) with bit flipping (Little -> Big endian)
#pragma once
#include <stdio.h>
#include <fstream>
#include <stdint.h>
inline uint32_t read_big_int(std::fstream &fileStream) {
unsigned char bytes[4];
fileStream.read((char*)bytes, 4);
return (uint32_t)((bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3]);
@mrousavy
mrousavy / RelayCommand.cs
Created September 25, 2017 07:56
An event basede ICommand implementation for WPF
using System;
using System.Windows.Input;
public class RelayCommand : ICommand {
private readonly Predicate<object> _canExecute;
private readonly Action<object> _execute;
public RelayCommand(Action<object> execute, Predicate<object> canExecute = null) {
_execute = execute ?? throw new ArgumentNullException(nameof(execute));
_canExecute = canExecute ?? (o => true);
@mrousavy
mrousavy / CSharpSyntax.xshd
Created August 21, 2017 10:25
C# RegEx based (No AST) syntax highlighting
<SyntaxDefinition name="CSharp" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="CommentSingle" foreground="#0cad31" />
<Color name="CommentMulti" foreground="#068724" />
<Color name="String" foreground="Orange" />
<Color name="Char" foreground="DarkOrange" />
<Color name="Digits" foreground="DarkBlue"/>
<RuleSet>
<Span color="CommentSingle" begin="//" />
@mrousavy
mrousavy / AnimationExtensions.cs
Created August 21, 2017 10:23
Useful async extensions for WPF UIElements/Animatable for animating with ease
using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media.Animation;
namespace mrousavy {
public static class AnimationExtensions {
/// <summary>
/// Animate a given <see cref="UIElement" />/<see cref="System.Windows.Controls.Control" /> asynchronous (awaitable)
/// </summary>