Skip to content

Instantly share code, notes, and snippets.

View catalinmiron's full-sized avatar
🎥
https://www.youtube.com/c/catalinmirondev

Catalin Miron catalinmiron

🎥
https://www.youtube.com/c/catalinmirondev
View GitHub Profile
//
// ContentView.swift
// Emoji Animation hero picker
//
// Created by Moussa on 3/4/2024.
//
import SwiftUI
struct ContentView: View {
import ExpoModulesCore
import SwiftUI
public class SwiftuiViewModule: Module {
public func definition() -> ModuleDefinition {
Name("SwiftuiForm")
View(SwiftuiView.self) {
Prop("name") { (view, name: String) in
view.name = name
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
for (i, view) in scrollView.subviews.enumerated() {
var ty = 0.0
if scrollView.contentOffset.y < 0 {
// We're scrolling past the top of the scroll view.
// Translate each item in the scroll view by some amount based on its index and scroll offset.
ty = CGFloat(i) * abs(offsetY) / 8.0 * pow(1.12, CGFloat(i))
}
view.transform = CGAffineTransform(translationX: 0, y: ty)
}
@steveruizok
steveruizok / [...nextauth].ts
Last active May 12, 2022 21:39
Helpers for Github Sponsorware
// pages/api/auth/[...nextauth.ts]
// Follow docs in nextauth
import { isSignedInUserSponsoringMe } from 'utils/github'
import type { NextApiHandler, NextApiRequest, NextApiResponse } from 'next'
import NextAuth from 'next-auth'
import GithubProvider from 'next-auth/providers/github'
export default function Auth(
@hirbod
hirbod / expoAnimatedWebPforIOSandAndroid.md
Last active January 10, 2024 09:11
expo-config-plugin: animated webP support for Expo SDK44+ and Custom Dev Client (with FastImage) support

I recommend to not use this anymore. Switch over to expo-image

If anybody needs animated webP support with Expo (Custom Dev Client) for the native <Image /> and <FastImage /> (read comments):

Android

// create a file like plugins/withAnimatedWebPSupport.js -> this is for the native <Image />

const {
@EvanBacon
EvanBacon / RootViewBackgroundColor.tsx
Created December 10, 2021 21:44
A stack based Expo component for setting the background color of the root view. Useful for changing the background color on certain screens or inside of native modals. Updates based on Appearance and AppState.
import * as SystemUI from 'expo-system-ui';
import * as React from 'react';
import { Appearance, AppState, AppStateStatus, ColorSchemeName, ColorValue } from 'react-native';
type ThemedColorValue = { light: ColorValue, dark: ColorValue };
type Props = { backgroundColor: ColorValue | ThemedColorValue }
const propsStack: Props[] = [];
@steveruizok
steveruizok / sponsors.ts
Created November 19, 2021 13:38
A Next.js API route that will generate an image of your most recent 100 Github sponsors.
// pages/api/sponsors.ts
import { NextApiRequest, NextApiResponse } from 'next'
const AV_SIZE = 32
const PADDING = 4
const COLS = 16
type SponsorResult = { avatarUrl: string; login: string }
@steveruizok
steveruizok / usePublishCallback.ts
Created September 23, 2021 16:34
Croquet.io React Bindings (requires @croquet/react and @croquet/croquet)
import * as React from "react"
import { Model } from "@croquet/croquet"
import { CroquetContext } from "@croquet/react"
/**
* A callback that publishes the returned data to the current view's model.
* @param eventName The name of the event to be published.
* @param fn A function that returns the data to be published.
* @param deps (optional) An array of dependencies for the callback.
*/
@cawfree
cawfree / react-native-macos-catalyst.md
Last active July 17, 2023 10:09
How to use React Native and MacOS Catalyst

Follow these steps to run your React Native application using MacOS Catalyst.

  1. Use the following package versions:
+ "metro-react-native-babel-preset": "^0.59.0",
+ "react-native": "0.63.0",
+ "react-native-macos": "^0.63.23",
@eldadfux
eldadfux / .env
Last active June 29, 2022 05:24
Appwrite 0.14 - Stack
_APP_ENV=production
_APP_LOCALE=en
_APP_OPTIONS_ABUSE=enabled
_APP_OPTIONS_FORCE_HTTPS=disabled
_APP_OPENSSL_KEY_V1=your-secret-key
_APP_DOMAIN=localhost
_APP_DOMAIN_TARGET=localhost
_APP_CONSOLE_WHITELIST_ROOT=enabled
_APP_CONSOLE_WHITELIST_EMAILS=
_APP_CONSOLE_WHITELIST_IPS=