Skip to content

Instantly share code, notes, and snippets.

View crstnmac's full-sized avatar
🎵
NP: Ocean Eyes - Blackbear Remix (Billie Ei… (2:50/3:15)

Criston Mascarenhas crstnmac

🎵
NP: Ocean Eyes - Blackbear Remix (Billie Ei… (2:50/3:15)
View GitHub Profile
@jarretmoses
jarretmoses / React Native Clear Cache
Last active April 23, 2025 11:20
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active April 22, 2025 14:27
React Native Bridging Cheatsheet
@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active March 20, 2025 20:49
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@roipeker
roipeker / glassbox.dart
Created December 10, 2020 02:33
GlassBox - Flutter Widget: Glassmorphism style .
/// roipeker 2020.
import 'dart:ui';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
/// Usage:
/// ```
/// GlassBox(
/// width: 140,
@mattupham
mattupham / @mattupham Omegle IP Location Finder
Last active October 15, 2024 05:51
@mattupham Omegle IP Location Finder - Ask Questions in our Discord, links below
// Subscribe on YouTube, and follow on TikTok (@mattupham)! Socials found below:
// https://mattupham.com/links
// @ me on Discord with any questions!
https://link.mattupham.com/discord
// --------------------------------------------
// PLEASE REPLACE "your-api-key-here" WITH AN
// API KEY FROM https://ipgeolocation.io/
let apiKey = "your-api-key-here";
@joshcawthorne
joshcawthorne / useWindowSize.js
Last active February 24, 2025 06:43
SSR-Compatible (NextJS, Gatsby etc) React hook for getting Window Size.
import { useState, useEffect } from "react";
function useWindowSize() {
const [windowSize, setWindowSize] = useState<{ width: number | undefined; height: number | undefined }>({
width: undefined,
height: undefined,
});
useEffect(() => {
function handleResize() {
@danielroe
danielroe / settings.json
Last active April 19, 2025 06:36
VScode settings for a minimal UI
{
// Disable telemetry
"telemetry.telemetryLevel": "off",
// Zen mode
"zenMode.fullScreen": false,
"zenMode.hideTabs": true,
"zenMode.centerLayout": false,
// Theming
"workbench.iconTheme": "city-lights-icons-vsc",
"editor.fontFamily": "Dank Mono",
type AnyFunction = (...args: any[]) => any
function useEvent<T extends AnyFunction>(callback?: T) {
const ref = useRef<AnyFunction | undefined>(() => {
throw new Error("Cannot call an event handler while rendering.")
})
// Or useInsertionEffect if it's React 18
useLayoutEffect(() => {
ref.current = callback
})
@nathanchase
nathanchase / [...].ts
Last active March 7, 2024 02:34
Nuxt 3 Server API catch-all w/ caching, retries, and request/response logging (with total elapsed time)
// Here's my current implementation of a Nuxt 3 server API catch-all with caching, retries, and request/response logging with total elapsed time:
// Place in: /server/api/[...].ts
import LRU from 'lru-cache';
import { getCookie } from 'h3';
const config = useRuntimeConfig();
const cache = new LRU({
max: 100,
import AsyncStorage from '@react-native-async-storage/async-storage';
import create from 'zustand';
import { persist } from 'zustand/middleware';
export const useSomthingStore = create<TSomthingStore>(
persist(
(set, get) => ({
isTrue: false,
_hasHydrated: false,
setHasHydrated: state => {