Skip to content

Instantly share code, notes, and snippets.

View mrmartineau's full-sized avatar
👋
Aho Young Warrior

Zander Martineau mrmartineau

👋
Aho Young Warrior
View GitHub Profile
@mrmartineau
mrmartineau / UserProvider.tsx
Created October 11, 2023 12:01
Supabase / Next 13 user prefs question
View UserProvider.tsx
'use client';
import { createClientComponentClient } from '@supabase/auth-helpers-nextjs';
import { ReactNode, createContext, useCallback, useContext } from 'react';
import { useRealtimeProfile } from '../hooks/useRealtime';
import { UserProfile } from '../types/db';
export type UseUpdateReturn = (action: UIStateAction) => void;
type UIState = UserProfile['settings'];
export type UIStateAction =
View Button.styles.css
:root {
--padding-1: 0.25rem;
--padding-2: 0.5rem;
--padding-3: 0.75rem;
--padding-4: 0.75rem;
}
.button {
padding: var(--padding-1);
border: none;
View github-hotkeys-boost.css
[data-hotkey]:not(.selected)::after {
content: attr(data-hotkey);
color: var(--color-fg-muted);
background-color: var(--color-neutral-subtle);
margin-left: var(--primer-control-medium-gap, 4px);
border-radius: 2em;
font-family: monospace;
display: inline-block;
font-size: var(--primer-text-body-size-small, 12px);
font-weight: var(--base-text-weight-medium, 500);
View iOS-URL-schemes.txt
BIG iOS URL SCHEME LIST
HAD TO MAKE A DROPBOX FILE BECAUSE THIS LIST WAS TOO LONG TO POST IN THE COMMENTS OR NOT MAKE THE WORKFLOW APP TAKE FOREVER TO READ IT.
☠JAILBREAK/SYSTEM APPS
--------------------------
activator://
itms-apps://
itms-services://
@mrmartineau
mrmartineau / HowToTest.md
Created March 28, 2020 23:16 — forked from tkrotoff/HowToTest.md
How I structure my tests
View HowToTest.md

File structure

  • src/fooBar.js
  • src/fooBar.html
  • src/fooBar.scss
  • src/fooBar....
  • src/fooBar.test.js => npm run test
  • src/fooBar.test.e2e.js (if I have E2E tests - Puppeteer, Playwright...) => npm run test:e2e

Tests should not be separated from the source code (think autonomous modules).

View chrome-extensions.md
@mrmartineau
mrmartineau / settings.json
Last active February 13, 2024 12:16
vscode settings.json
View settings.json
{
"[handlebars]": {
"editor.formatOnSave": false
},
"[markdown]": {
"editor.quickSuggestions": {
"comments": "off",
"other": "off",
"strings": "off"
}
@mrmartineau
mrmartineau / .babelrc
Last active July 1, 2018 21:39
jest/styled-components snapshot bug...
View .babelrc
{
"presets": [
[
"env",
{
"modules": false
}
],
"react"
],
@mrmartineau
mrmartineau / connect.js
Created June 6, 2018 14:24
Redux examples
View connect.js
import React from 'react'
import { connect } from 'react-redux'
import { doClearQuery } from './some/file/of/action/creators'
// We again use a simple, functional component.
const OurComponent = ({ query, results, clearQuery }) => (
<div>
query: {query}
<button onClick={clearQuery}>Clear</button>
<ul>