Skip to content

Instantly share code, notes, and snippets.

View thedevdavid's full-sized avatar
🎯
Focusing

David thedevdavid

🎯
Focusing
View GitHub Profile
@thedevdavid
thedevdavid / formfield.tsx
Created September 4, 2023 16:42
@shadcn/ui custom remote
<FormField
control={form.control}
name="type"
render={({ field }) => (
<FormItem>
<FormLabel>Work from...</FormLabel>
<FormControl>
<RadioGroup onValueChange={field.onChange} defaultValue={field.value} className="flex flex-wrap">
<FormItem className="flex space-x-1 space-y-1">
<FormControl>
{
"Use Client": {
"prefix": ["uc", "useclient"],
"body": ["\"use client\";"],
"description": "Inserts use client statement"
}
}
@thedevdavid
thedevdavid / file.md
Created July 26, 2023 09:43
WWC Supabase DB Gen

Prompt:

Create a database. Create a habits table with an id, a habit name, an isCompletedToday flag, a userID foreign key relation, a color property, and a start_date. Create another table called users with userID, email. I need a third table for logging habit completions. Related to a habit ID, a completion date.

SQL:

-- Create a users table
create table users (
 user_id uuid primary key default uuid_generate_v4(),
@thedevdavid
thedevdavid / CODE_OF_CONDUCT.md
Created July 5, 2023 18:39
Code of Conduct for my projects

Contributor Covenant Code of Conduct

Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

@thedevdavid
thedevdavid / next.config.js
Created October 5, 2020 12:24
Preact Next config
const withPlugins = require('next-compose-plugins');
const withPrefresh = require('@prefresh/next');
const nextImg = require('next-img/plugin');
const plugins = [
[
nextImg,
{
persistentCache: false,
jpeg: {
@thedevdavid
thedevdavid / .zshrc
Last active December 16, 2020 15:51
.zshrc
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
### Keybase proof
I hereby claim:
* I am dlevai94 on github.
* I am davidlevai (https://keybase.io/davidlevai) on keybase.
* I have a public key ASAOdV3xUbOJPm2SsdSixNjloFsfFPQMbATUD0orpJh-Fgo
To claim this, I am signing this object:
@thedevdavid
thedevdavid / App.js
Created February 26, 2018 12:59
Final App.js
import React, { Component } from 'react';
import {
Text,
View,
ActivityIndicator,
FlatList,
Button,
TouchableOpacity,
} from 'react-native';
import firebase from 'react-native-firebase';
@thedevdavid
thedevdavid / auth.js
Created February 26, 2018 10:48
Auth reducer
import types from '../actions/types';
const initialState = {
loggedIn: false,
isFetching: false,
hasError: false,
errorMessage: '',
user: null
};
@thedevdavid
thedevdavid / index.js
Created February 26, 2018 10:40
index.js
import React from 'react';
import { AppRegistry, Text } from 'react-native';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/lib/integration/react';
import configureStore from './src/config/store';
import App from './App';
const { store, persistor } = configureStore();