Skip to content

Instantly share code, notes, and snippets.

View botanicodes's full-sized avatar

Joe Rivard botanicodes

  • Open Systems Technologies
  • Eugene, OR
View GitHub Profile
@botanicodes
botanicodes / drop-all-tables.sql
Created October 31, 2022 22:28
Force Drop All Tables
DECLARE @fkSql nvarchar(max) = N'';
DECLARE @dropSql nvarchar(max) = N'';
DECLARE @nl nvarchar(10) = CHAR(13)+CHAR(10);
;WITH fk(fkName, fkTable) AS
(
SELECT [name] as fkName, OBJECT_NAME(parent_object_id) as fkTable
FROM sys.foreign_keys
)
SELECT @fkSql += N'ALTER TABLE ' + fkTable + N' drop constraint ' + fkName + ';' + @nl FROM fk;
@botanicodes
botanicodes / table.tsx
Created October 8, 2022 18:04 — forked from noghartt/table.tsx
@tanstack/table + @tanstack/virtual@beta + @mui/material v5 | A table with infinite scrolling and virtualized rows
import Paper from '@mui/material/Paper';
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
import TableCell from '@mui/material/TableCell';
import TableContainer from '@mui/material/TableContainer';
import TableHead from '@mui/material/TableHead';
import TableRow from '@mui/material/TableRow';
import {
useReactTable,
getCoreRowModel,
@botanicodes
botanicodes / BaseEntity.cs
Last active January 6, 2023 18:43
EF Core Entity & Extensions
namespace Botanicodes.Common.Entities
{
public interface IEntity
{
}
public interface IEntity<TKey> : IEntity
{
TKey Id { get; set; }
@botanicodes
botanicodes / code-words.md
Created December 8, 2021 01:57
Coding Standards

Code Words

List of common words used when implementing common patterns

Words

  • Adapter - Match interfaces of different classes
  • Analyzer
  • Behavior
  • Builder - Separates object construction from its representation
  • Collector
  • Command -
@botanicodes
botanicodes / code-words.md
Last active July 7, 2020 20:49
Code Word Glossary

Words

Adapter - Match interfaces of different classes Behavior Builder - Separates object construction from its representation Command - Container Context Controller Converter Decorator - Add responsibilities to objects dynamically

@botanicodes
botanicodes / IAuditableExtensions.cs
Created April 30, 2020 15:30
Apply IAuditable Configuration to all entities
using Microsoft.EntityFrameworkCore;
using Midmark.RTLS.Common.Entities.Abstractions;
using Midmark.RTLS.Common.Extensions;
using Midmark.RTLS.Common.Guards;
using System;
using System.Linq;
using System.Reflection;
namespace Midmark.RTLS.Operations.Data.Extensions
{