Skip to content

Instantly share code, notes, and snippets.

View harrisrobin's full-sized avatar
🛳️
Shipping

harris.dev harrisrobin

🛳️
Shipping
View GitHub Profile
@harrisrobin
harrisrobin / api.ts
Created March 20, 2025 22:06
syntax-highlighting-tests
/**
* This Api class lets you define an API endpoint and methods to request
* data and process it.
*/
import { ApisauceInstance, create } from 'apisauce'
import type {
ApiConfig,
CloudHeroSummaryParams,
CloudHeroSummaryRow,
CloutHeroQuickOverviewParams,
@harrisrobin
harrisrobin / next.config.mjs
Created October 3, 2024 11:34
Useful snippets
module.exports = {
compiler: {
removeConsole: {
exclude: ['error']
}
}
}
@harrisrobin
harrisrobin / ably-providers.tsx
Created September 29, 2024 19:06
ably-providers.tsx
"use client"
import { ChatClient, LogLevel } from "@ably/chat"
import { ChatClientProvider } from "@ably/chat/react"
import type { User } from "@supabase/supabase-js"
import * as Ably from "ably"
import { AblyProvider } from "ably/react"
enum AblyLogLevel {
Silent = 0,
Error = 1,
"use client"
import { GameChatMessagesListItem } from "@/app/[locale]/(dynamic)/cs/lobby/[room]/_components/game-chat-message-list-item"
import { Button } from "@/components/ui/button"
import { Textarea } from "@/components/ui/textarea"
import type { MatchForLobby } from "@/types/database.types"
import type { Message } from "@ably/chat"
import { useMessages } from "@ably/chat/react"
import { useUser } from "@supabase/auth-helpers-react"
import type { User } from "@supabase/supabase-js"
import { useCallback, useEffect, useRef, useState } from "react"
import { seo } from "@/config/seo"
import "./globals.css"
import { Providers } from "@/app/providers"
import { Provider as AnalyticsProvider } from "@repo/analytics/client"
import type { Metadata, Viewport } from "next"
import { SiteChat } from "@/components/site-chat"
import { SupabaseAuthListener } from "@/components/supabase-auth-listener"
import { Toaster } from "@/components/ui/sonner"
import { fontSans } from "@/config/fonts"
@harrisrobin
harrisrobin / button.dripsy.tsx
Last active February 6, 2024 08:03
Dripsy vs useColorToken
import React from "react"
import {
PressableStateCallbackType,
Pressable,
StyleProp,
ViewStyle,
} from "react-native"
import { ButtonProps, ButtonVariants } from "./button.props"
import { Text } from "../text"
import { useDripsyTheme, useSx } from "dripsy"
@harrisrobin
harrisrobin / Fastlane.rb
Created August 9, 2023 09:56
Fastlane CI/CD automation suite for React-Native. Supports multiple envs (staging app & prod app), slack notifications, Sentry sourcemaps & dsym uploading, codepush etc. Very extensive and handles all release/beta requirements.
require "json"
require "httparty"
require "sem_version"
require 'xcodeproj'
#
# CONSTS
#
FASTLANE_ENV_FILE = ".fastlane"
PROJECT = "REDACTED"
@harrisrobin
harrisrobin / analytics.ts
Last active August 9, 2023 10:00
Typed & re-useable analytics module to make it easy to add new analytics tools to the app without having to touch multiple files
import * as Analytics from "expo-firebase-analytics"
import { recordError } from "./exceptions"
export const setCurrentScreen = (screenName: string): void => {
void Analytics.logEvent("screen_view", { screen_name: screenName })
// track screens.
__DEV__ && console.tron.log(`currentScreen: ${screenName}`)
}
/**
@harrisrobin
harrisrobin / text.props.ts
Created August 9, 2023 09:31
Re-useable React-Native text component with proper theming, ability to pass "tx" for translations and theme-ui like styling prop (sx).
import { TextProps as TextProperties } from "react-native"
import type { SxProps } from "@bridge/ui/view"
import type { Nullable } from "@bridge/types"
import { TextVariants } from "../theme"
export interface TextProps extends TextProperties, SxProps {
/**
* Children components.
*/
children?: React.ReactNode
export const GENERATION_MODELS: Record<string, GenerationModel> = {
"6c2ccdf0300616cfca3ba78701b511def42447960b086bb47a487aed5a9a892d": {
name: "Realism",
path: "models/ckpt/aresmix.safetensors",
vae: "models/vae/vae-ft-mse-840000-ema-pruned.safetensors",
modelHash:
"6c2ccdf0300616cfca3ba78701b511def42447960b086bb47a487aed5a9a892d",
positivePromptStart: `${POSITIVE_PROMPT_START}, RAW photo, cinematic still, high quality, film grain, sharp focus, (high detailed skin:1.2), 8k uhd, dslr, award winning photograph,`,
},
c5b6055a843f079998738c7d115060a4e116f0eedd1a5cb10b2b52d6f5f0ff68: {