Skip to content

Instantly share code, notes, and snippets.

View csauvage's full-sized avatar
🏠
Working from home

Clément Sauvage csauvage

🏠
Working from home
View GitHub Profile

🎯 useUserAction System - Complete Codex & Implementation Guide

A comprehensive, type-safe user action tracking system for the Leadstar platform with extreme TypeScript safety, automatic user identification, and dual storage capabilities.


📋 Table of Contents

  1. Overview & Philosophy
  2. Quick Start Guide
@csauvage
csauvage / AGENTS.md
Last active October 8, 2025 06:40
CODEX AGENTS.md

You are a senior front-end architect.
Always respect Atomic Design principles and enforce strict reusability, purity, and statelessness.
Build components only with the hierarchy and workflow below so that every teammate—including non-engineers—understands the design system boundaries and collaboration flow.


Purpose & Audience

  • This brief sets expectations for anyone collaborating on UI work.
  • Engineers learn the component contract before touching code.
  • Designers / product / content gain a shared language to review deliverables and spot issues early.
export enum PurchaselyEvent {
ACTIVATE = 'ACTIVATE',
DEACTIVATE = 'DEACTIVATE'
}
export enum PurchaselyStore {
APPLE_APP_STORE = 'APPLE_APP_STORE',
GOOGLE_PLAY_STORE = 'GOOGLE_PLAY_STORE',
AMAZON_APPSTORE = 'AMAZON_APPSTORE',
HUAWEI_APPGALLERY = 'HUAWEI_APPGALLERY',
import React, { useEffect, useState } from 'react';
import './Checkout.sass';
import { CheckCircle, Loader } from '../../assets/img/icons';
import Button from '../../components/forms/Button';
import CustomerService from '../../components/Checkout/CustomerService';
import Footer from '../../components/Checkout/Footer';
import Stepper from '../../components/Checkout/Stepper';
import CheckoutMenu from '../../components/Checkout/CheckoutMenu';
import { useHistory } from 'react-router-dom';
@csauvage
csauvage / Spencer_Williams_Stores.json
Last active November 11, 2022 11:58
Algolia demo stores dataset
[
{
"name": "Hartsfield Jackson Atlanta Intl",
"city": "Atlanta",
"country": "United States",
"_geoloc": { "lat": 33.636719, "lng": -84.428067 },
"popularity": 1826,
"services": ["Package Pickup", "Open 24/24"],
"objectID": "3682"
},
@csauvage
csauvage / Checkout.tsx
Last active April 27, 2021 08:09
useElements and React Elements
const Component = () => {
const stripe = useStripe();
const elts = useElement();
handlePayment = () => {
const cardElement = elements.getElement(CardNumberElement);
stripe.confirmCardSetup('seti_1IkV0QFBr5u7...', {
payment_method: {
Map(
"SCO" -> "Angers SCO",
"MET" -> "FC Metz",
"BRE" -> "Brest",
"GIR" -> "Bordeaux",
"DIJ" -> "Dijon FCO",
"RCL" -> "RC Lens",
"LIL" -> "LOSC",
"FCL" -> "FC Lorient",
"OL" -> "OL",
@csauvage
csauvage / SMS.js
Last active October 12, 2017 12:05
Sending an SMS using Twilio
const client = require(‘twilio’)(
config.TWILIO_SID,
config.TWILIO_AUTH_TOKEN
);
client.messages.create({
from: '+336XXXXXXXX', /* Twilio's provided number*/
to: '+336XXXXXXXX', /* SMS recipient */
body: “Hello SMS from Node.js”
}).then((messsage) => console.log(message.sid));
@csauvage
csauvage / XMLVergeExample.xml
Last active August 29, 2015 14:23
The Verge's XML Structure
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
<title>The Verge - Apple Posts</title>
<icon>...</icon>
<updated>2015-06-12T18:17:50-04:00</updated>
<id>http://www.theverge.com/apple/rss/index.xml</id>
<link type="text/html" href="http://www.theverge.com/apple" rel="alternate"/>
<entry>
<published>2015-06-12T18:17:50-04:00</published>
<updated>2015-06-12T18:17:50-04:00</updated>
<title>...</title>
@csauvage
csauvage / KKClient.h
Last active August 29, 2015 14:17
AFNetworking - Singleton
#import "AFHTTPSessionManager.h"
@interface KKClient : AFHTTPSessionManager
+ (instancetype)sharedClient;
- (NSURLSessionDataTask *)connectTo:(NSString *)path
withcompletion:(void (^)(NSArray *results, NSError *error))completion;
@end