Skip to content

Instantly share code, notes, and snippets.

View MantasMikal's full-sized avatar
🧙‍♂️
Centering the <View>

Mantas Mikalauskas MantasMikal

🧙‍♂️
Centering the <View>
View GitHub Profile
@nandorojo
nandorojo / eas-update-sentry.ts
Last active May 31, 2024 02:49
EAS Update + Sentry Source Maps
import { getConfig } from '@expo/config'
import fs from 'fs'
import spawnAsync from '@expo/spawn-async'
import chalk from 'chalk'
import path from 'path'
const appDir = process.cwd()
console.log()
console.log(chalk.green('Sentry source maps script. Working directory:'))
@nderscore
nderscore / TamaguiSolitoTextLink.tsx
Last active October 21, 2023 17:45
Example Tamagui Solito Text Link
@nandorojo
nandorojo / DraggableScrollView.tsx
Last active April 19, 2024 07:12
Make a horizontal `ScrollView` draggable with a mouse (`react-native-web`)
import React, { ComponentProps } from 'react'
import { ScrollView } from 'react-native'
import { useDraggableScroll } from './use-draggable-scroll'
export const DraggableScrollView = React.forwardRef<
ScrollView,
ComponentProps<typeof ScrollView>
>(function DraggableScrollView(props, ref) {
const { refs } = useDraggableScroll<ScrollView>({
outerRef: ref,
# Know the id of the username in the original distro that was exported
wsl -d Ubuntu-20.04 -u kartz -e id -u
# Outputs 1000
# Knowing the id of the username in the distro that was created by importing the tar image
wsl -d Ubuntu-20 -u kartz -e id -u
# Outputs 1000
# I would want to use this distroname and id, to set this user as the default login profile of WSL.
# I set this up in Windows Registry with the line snippet below:
@leodutra
leodutra / -setup-windows-wsl-devenv.md
Last active July 20, 2024 20:44
Install and Setup Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

Setup Windows Subsystem 2 for Linux

Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

To setup native Linux, see this gist

Preview

Requirements

@Raju
Raju / Linux or WSL Development Setup
Last active October 5, 2023 05:28
Development Setup
APT FAST
--------
sudo add-apt-repository ppa:apt-fast/stable &&
sudo apt-get update &&
sudo apt-get -y install aria2 apt-fast
/bin/bash -c "$(curl -sL https://git.io/vokNn)"
YADM
----
@Tamal
Tamal / git-ssh-error-fix.sh
Last active July 8, 2024 13:24
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
@jefflau
jefflau / App.js
Last active March 27, 2022 11:27
Multiple layouts with React Router V4
/* Inspired by: https://gist.github.com/avinmathew/e82fe7e757b20cb337d5219e0ab8dc2c */
import React, { Fragment } from 'react'
import {
BrowserRouter as Router,
Route as DefaultRoute,
Switch
} from 'react-router-dom'
import TestRegistrar from './routes/TestRegistrar'
import Home from './routes/Home'
import SingleName from './routes/SingleName'
@noelbundick
noelbundick / LICENSE
Last active May 24, 2024 09:10
Exclude WSL installations from Windows Defender realtime protection
MIT License
Copyright (c) 2018 Noel Bundick
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@paulirish
paulirish / what-forces-layout.md
Last active July 22, 2024 06:32
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent