Skip to content

Instantly share code, notes, and snippets.

View badalsaibo's full-sized avatar
🌱
Do. Doing.

badal badalsaibo

🌱
Do. Doing.
  • India
View GitHub Profile
@4wk-
4wk- / README.md
Last active July 28, 2025 14:52
Clean uninstall then reinstall of WSL on Windows 10, with systemD support

Uninstall then reinstall WSL on Windows 10 (clean way)

Background

I've been using wsl (version 2) with genie mod for years without issue, but one day, Windows 10 finally catch up on wsl Windows 11 features and gives us a way to use systemD natively.

I wanted to use the new "right way" to enable systemD on Windows Subsystem for Linux (without genie), and I also had a (probably related) infinite Windows RemoteApp error poping in.

Fixing it

A - Uninstall wsl and related stuff

  1. In powershell (as admin)
import { BottomSheetModal, BottomSheetModalProps } from '@gorhom/bottom-sheet';
import { useCallback, useRef } from 'react';
import { BackHandler, NativeEventSubscription } from 'react-native';
/**
* hook that dismisses the bottom sheet on the hardware back button press if it is visible
* @param bottomSheetRef ref to the bottom sheet which is going to be closed/dismissed on the back press
*/
export const useBottomSheetBackHandler = (
bottomSheetRef: React.RefObject<BottomSheetModal | null>,
@gregfenton
gregfenton / AuthProvider.js
Created February 8, 2022 03:18
A React/React-Native authentication provider that uses the Context API to make authentication & profile info available to "the rest of the app"
import React, {createContext, useEffect, useState} from 'react';
import auth from '@react-native-firebase/auth'; // or from 'firebase/auth';
import Loading from '../components/Loading';
import {myFirestore} from '../common/firebase.js';
export const AuthContext = createContext({});
export const AuthProvider = (props) => {

Layout projection: A method for animating browser layouts at 60fps

Introduction

Animating layout is hard. Prohibitively so; how many ambitious designers have provided dev teams dazzling videos of app-quality UI animations, only to be rebuffed?

If you're a web developer, what would your reaction be if asked to realise this kind of App Store-style interaction, where an item opens into a full-screen view when clicked:

Y2Mate.is.-.Inside.Framer.Motion.s.Layout.Animations.-.Matt.Perry-5-JIu0u42Jc-1080p-1651813013467.online-video-cutter.com.mp4
@dannysmc95
dannysmc95 / pure-downloaded-capacitor.js
Last active February 18, 2024 03:02
Download a file with pure Capacitor FileSystem and the Fetch API.
const downloadFile = async (uri, path, folder) => {
return new Promise(async (resolve, reject) => {
try {
const file_request = await fetch(uri, {
method: 'GET',
credentials: 'include',
mode: 'cors',
});
const file_blob = await file_request.blob();
@ShopifyEng
ShopifyEng / Confetti.tsx
Created April 6, 2020 17:11
Building Arrive's Confetti in React Native with Reanimated - Confetti Final
import React, {useMemo} from 'react'
import Animated from 'react-native-reanimated'
import {View, Dimensions, StyleSheet} from 'react-native'
import FastImage from 'react-native-fast-image'
import ConfettiImage from 'assets/images/confetti.png'
const NUM_CONFETTI = 100
const COLORS = ['#00e4b2', '#09aec5', '#107ed5']
const CONFETTI_SIZE = 16
@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active July 14, 2025 09:28
Building a react native app in WSL2
@derekstavis
derekstavis / FastList.tsx
Last active May 13, 2025 05:45 — forked from vishnevskiy/FastList.js
Discord's FastList, but in TypeScript
import { forEachObjIndexed } from "ramda";
import * as React from "react";
import {
Animated,
ScrollView,
View,
ViewStyle,
LayoutChangeEvent,
NativeScrollEvent,
} from "react-native";
@reinvanoyen
reinvanoyen / terminal-prompt-git-branch-zsh.md
Last active July 27, 2025 16:55
Add Git Branch Name to Terminal Prompt (MacOS zsh)

Add Git Branch Name to Terminal Prompt (zsh)

Updated for MacOS with zsh

  • Catalina
  • Big Sur
  • Monterey
  • Ventura
  • Sonoma

screenshot

@parmentf
parmentf / GitCommitEmoji.md
Last active July 29, 2025 03:04
Git Commit message Emoji