Skip to content

Instantly share code, notes, and snippets.

View stolinski's full-sized avatar
💭
Syntax.fm

Scott Tolinski stolinski

💭
Syntax.fm
View GitHub Profile
<div></div>
<style>
body {
background: linear-gradient(180deg, #D25B70 50%, #6CB3A9 50%)
}
div {
width: 200px;
height: 200px;
border-radius: 50%;
margin: 50px auto;
<div></div>
<style>
body {
background: #293462;
margin: 0;
}
div {
width: 200px;
height: 200px;
background: #FFF1C1;
@stolinski
stolinski / drizzle-error.ts
Created January 4, 2024 04:59
Error: There is not enough information to infer relation "__public__.habits.checks" at normalizeRelation
// Schema
import { relations } from 'drizzle-orm';
import { serial, text, timestamp, pgTable, date, integer } from 'drizzle-orm/pg-core';
export const habits = pgTable('habits', {
id: serial('id').primaryKey(),
name: text('name'),
days_per_month: integer('days_per_month'),
created_at: timestamp('created_at'),
updated_at: timestamp('updated_at')
@stolinski
stolinski / mockingvite.ts
Last active July 19, 2022 17:25
Mockingoose Vitest
// Mockingvite = Vitest + Mockingoose aka Mongoose Mocking for Vitest
// A Vitest compatable version of Mockingoose
// Docs avaiable here https://github.com/alonronin/mockingoose
// Support my work by becoming a Level Up Pro - leveluptutorials.com
import { vi } from 'vitest'
import mongoose from 'mongoose'
if (!/^5/.test(mongoose.version)) {
@stolinski
stolinski / mongoose+5.11.8.patch
Created February 2, 2021 17:33
Patch to fix mongoose for esbuild
diff --git a/node_modules/mongoose/lib/index.js b/node_modules/mongoose/lib/index.js
index 1425cfa..631eba5 100644
--- a/node_modules/mongoose/lib/index.js
+++ b/node_modules/mongoose/lib/index.js
@@ -732,19 +732,19 @@ Mongoose.prototype.connections;
* Driver dependent APIs
*/
-const driver = global.MONGOOSE_DRIVER_PATH || './drivers/node-mongodb-native';
+
@stolinski
stolinski / gist:455135717c9e146f83955533860d58b0
Created November 13, 2020 22:12
Fake Contract - DO NOT USE
This Freelance Contract (this “Contract” or this “Freelance Contract”), is entered into and made effective as of [date] (the “Effective Date”), by and between [customer] (“Customer”), and [freelancer] (“Freelancer”).
WHEREAS:
Customer has a need for [services] and
Freelancer has an interest in performing such services for Customer; and
The parties wish to set forth the terms and conditions upon which such services will be provided to Customer;
NOW THEREFORE, in consideration of the foregoing, and the mutual promises herein contained, the parties hereby agree as follows:
Terms and Conditions
@stolinski
stolinski / style.css
Last active August 5, 2020 21:00
levelup-classless.css
@import url("https://fonts.googleapis.com/css?family=Space+Mono:400|Work+Sans:400");
:root {
/* Define Colors as colors */
--green: #00ebc7;
--red: #ff5470;
--yellow: #fde24f;
--black: #1b2d45;
--darkBlue: #00214d;
--darkGrey: #222;
@stolinski
stolinski / Example.tsx
Last active June 8, 2022 05:54
Route Transitions with Framer Motion
const FakeComponent = () => {
return (
<AnimatedRoutes exitBeforeEnter initial={false}>
<RouteTransition exact path="/some-route">
<NewUsers />
</RouteTransition>
<RouteTransition exact path="/yo" >
<Users />
</RouteTransition>
</AnimatedRoutes>
@stolinski
stolinski / providerCompose.js
Created April 23, 2019 17:40
ProviderComposer
function ProviderComposer({ contexts, children }) {
return contexts.reduceRight(
(kids, parent) =>
React.cloneElement(parent, {
children: kids,
}),
children
);
}
@stolinski
stolinski / Images.js
Created April 19, 2019 18:42
Images Array For useSprings
const pages = [
'https://images.pexels.com/photos/62689/pexels-photo-62689.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260',
'https://images.pexels.com/photos/296878/pexels-photo-296878.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260',
'https://images.pexels.com/photos/1509428/pexels-photo-1509428.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260',
'https://images.pexels.com/photos/351265/pexels-photo-351265.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260',
'https://images.pexels.com/photos/924675/pexels-photo-924675.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260'
]