Skip to content

Instantly share code, notes, and snippets.

View osterkraft's full-sized avatar

Eric Osterman osterkraft

  • Stockholm, Sweden
View GitHub Profile
@devnamipress
devnamipress / expo-rules.md
Last active May 6, 2025 15:20
cursor-rules-expo-react-native

Cursor Rules for Expo and React Native Projects

This document outlines the standardized rules and guidelines for developing mobile applications using Expo and React Native. These rules are designed to ensure consistency, maintainability, performance, accessibility, and error-free development across all projects. They apply to all Expo-based React Native apps and are crafted to minimize troubleshooting efforts and enforce best practices.

Cursor Adherence

  • Mandatory Compliance: Cursor must read and strictly follow all rules in this document for every Expo and React Native project.
  • Self-Check: Before generating code or modifying a project, Cursor must verify that its actions align with these guidelines.
  • Error Prevention: If Cursor detects a potential violation of these rules (e.g., creating a new project inside an existing one), it must halt and prompt the user for clarification instead of proceeding.
  • Documentation Reference: Cursor must reference this document (cursor-rules.md) w
@iDVB
iDVB / ScrollRestoration.js
Created August 27, 2024 15:07
Custom NextJS ScrollRestoration with async triggerRestore
import React, { createContext, useContext, useEffect, useRef } from 'react'
import Head from 'next/head'
import Router from 'next/router'
const ScrollRestorationContext = createContext(null)
export const useScrollRestoration = ({ router, ignorePattern: optsIgnorePattern }) => {
const shouldScrollRestore = useRef(true)
@tonyxiao
tonyxiao / docheadRoutes.jsx
Created March 10, 2016 23:00
Inject custom dochead into html returned by meteor server. Credit goes to https://github.com/thereactivestack/meteor-react-router-ssr
import React from 'react'
import {IndexRoute, Route} from 'react-router'
import Helmet from 'react-helmet'
const wrap = (Component) => (location, cb) => {
cb(null, Component)
}
const makeHelmet = (info) => {
const {title, description, image, url} = {
@nagelflorian
nagelflorian / circle.yml
Created January 14, 2016 13:04
CircleCI File for Meteor using Velocity with Jasmine and Galaxy for deployment
machine:
node:
version: 0.10.40
pre:
# download if meteor isn't already installed in the cache
- meteor || curl https://install.meteor.com | /bin/sh
post:
- meteor --version
checkout:
@maisano
maisano / RouteTransition.jsx
Last active September 15, 2023 07:29
Using react-motion with react-router
import React, { PropTypes } from 'react';
import { TransitionMotion, spring } from 'react-motion';
/**
* One example of using react-motion (0.3.0) within react-router (v1.0.0-rc3).
*
* Usage is simple, and really only requires two things–both of which are
* injected into your app via react-router–pathname and children:
*
* <RouteTransition pathname={this.props.pathname}>