Skip to content

Instantly share code, notes, and snippets.

View smdooley's full-sized avatar

Sean Dooley smdooley

View GitHub Profile
@devnamipress
devnamipress / expo-rules.md
Last active May 27, 2025 15:27
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
@AndyButland
AndyButland / AjaxFormPage.cshtml
Last active March 24, 2025 15:02
Umbraco Forms API usage with vanilla JavaScript
@*
Demonstration of using the Umbraco Forms 13 API for retrieving the definition of a form, rendering it and posting an entry.
It's based off an Umbraco content item with a property with alias "Form", of type "Form Picker".
*@
@using Microsoft.AspNetCore.Antiforgery
@using Microsoft.Extensions.Options;
@using Umbraco.Cms.Web.Common.PublishedModels;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.AJaxformPage>
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels;
@diazvictor
diazvictor / InventoryGame.js
Last active July 15, 2024 18:58
Small Example Of A Game Inventory With Javascript
/* jshint esversion: 8 */
// This example is a port of: https://gist.github.com/diazvictor/6fe3372bce79587a3c21123a19881cb1
// I create the Inventory class
class Inventory {
// What to do when the class is initialized
constructor() {
this.items = [];
}
@mattbrailsford
mattbrailsford / PriceBreakOrderLineCalculator.cs
Last active May 3, 2022 13:02
Example order line calculator that support price breaks
using System;
using System.Collections.Generic;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Web;
using Vendr.Core.Calculators;
using Vendr.Core.Models;
using Vendr.Core.Services;
using Vendr.Web.Models;
namespace Vendr.DemoStore.Web.Calculators
@barryokane
barryokane / PatternLibRazorViewEngine.cs
Created March 11, 2017 04:56
Inspired by Heather Floyd's article (http://24days.in/umbraco-cms/2016/unique-sites-using-theming), however our use case is slightly different: we want to share a library of partials between multiple Umbraco sites with custom overrides on specific sites
using System.Linq;
using Umbraco.Web.Mvc;
namespace Endzone.Umbraco.PatternLib
{
public class PatternLibRazorViewEngine : RenderViewEngine
{
public PatternLibRazorViewEngine() : base()
{
/*
@deMD
deMD / CommonServices
Created September 8, 2016 07:13
Code used to enable Ninject in Umbraco
using Ninject;
using Umbraco.IocTest.BLL.Providers;
using Umbraco.IocTest.Core.Interfaces;
namespace Umbraco.IocTest.BLL
{
/// <summary>
/// The CommonServices are services that are a 1:1 pair with an implemnting class.
/// For example: A single provider interface can only have one implmentation,
/// thus this is registered in the common services.
@greenygh0st
greenygh0st / LinkParser.cs
Created December 13, 2015 06:12
C# helper method for parsing out links and video (Vimeo & YouTube) content
using System;
using System.Text.RegularExpressions;
namespace DalesLab.Helpers
{
public static class Parser
{
public static readonly Regex VimeoVideoRegex = new Regex(@"vimeo\.com/(?:.*#|.*/videos/)?([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Multiline);
public static readonly Regex YoutubeVideoRegex = new Regex(@"youtu(?:\.be|be\.com)/(?:(.*)v(/|=)|(.*/)?)([a-zA-Z0-9-_]+)", RegexOptions.IgnoreCase);
public static readonly Regex HyperlinkRegex = new Regex("http(s)?://([\\w+?\\.\\w+])+([a-zA-Z0-9\\~\\!\\@\\#\\$\\%\\^\\&amp;\\*\\(\\)_\\-\\=\\+\\\\\\/\\?\\.\\:\\;\\'\\,]*)?", RegexOptions.IgnoreCase); //http://weblogs.asp.net/farazshahkhan/regex-to-find-url-within-text-and-make-them-as-link
@francoishill
francoishill / gist:6483997
Created September 8, 2013 11:27
Media queries for mobile devices - Requires at least requires the meta viewport tag with content 'width=device-width'
/*http://i-skool.co.uk/mobile-development/web-design-for-mobiles-and-tablets-viewport-sizes/*/
/*At least requires the meta viewport tag with content 'width=device-width'*/
@media only screen and (max-width: 1080px) and (orientation : portrait) {
/* PORTRAIT:
Windows Surface Pro*/
}
@media only screen and (max-width: 800px) and (orientation : portrait) {
/* PORTRAIT:
Acer Iconia Tab A100
@jayhjkwon
jayhjkwon / BookController.cs
Last active September 10, 2020 09:32
WebAPI2 Unit Testing with IHttpActionResult
// GET api/books
public IHttpActionResult Get()
{
return Ok(_repository.GetBooks().AsEnumerable());
}
// GET api/books/1
public IHttpActionResult Get(int id)
{
var book = _repository.GetBook(id);
@leekelleher
leekelleher / NavigationAToZ.xslt
Created November 24, 2011 11:22
XSLT snippet for generating an A to Z list for Umbraco content nodes.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#x00A0;">
]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">