Skip to content

Instantly share code, notes, and snippets.

View themadarchitect's full-sized avatar

Ethan Weibman themadarchitect

  • New York, New York
View GitHub Profile
version: 1.2.8
cache: true
registration:
socialLogins:
- "discord"
- "facebook"
- "github"
- "google"
- "openid"
@themadarchitect
themadarchitect / helpers.ts
Created May 9, 2024 15:01
Layout type helpers
import type React from 'react';
type ComponentPropsAs<
C extends React.ElementType<any>,
T extends React.ComponentPropsWithoutRef<C>['as'],
> = Omit<
Extract<React.ComponentPropsWithoutRef<C>, { as: T }>,
'as' | 'asChild'
>;
import { ElementType, FC, ReactNode } from 'react';
import { cn } from '@/lib/utils';
import React from 'react';
import { ComponentPropsWithout, RemovedProps } from './helpers';
import { Slot } from '@radix-ui/react-slot';
export interface LayoutProps {
className?: string;
children?: ReactNode;
}
@themadarchitect
themadarchitect / custom_iterator.cpp
Last active September 18, 2015 06:45 — forked from jeetsukumaran/custom_iterator.cpp
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>