sumatoken
sumatoken
Explore posts from servers
TTCTheo's Typesafe Cult
Created by sumatoken on 8/27/2023 in #questions
tRPC Context object empty
I fixed. I knew the function wasn't actually called anywhere so typescript gave me a hint when I tried to build the project. Here is what I had to do in /api/trpc/[trpc].ts:
export default trpcNext.createNextApiHandler({
router: appRouter,
createContext: createContext, // calling the ctx function
});
export default trpcNext.createNextApiHandler({
router: appRouter,
createContext: createContext, // calling the ctx function
});
3 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 8/11/2023 in #questions
How to deploy a GitBook on Vercel?
There is no package.json file. The repo is synced with the gitbook and it's only MDX files. The browser just renders MDX code.
5 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 8/3/2023 in #questions
Cool svg animation insight.
Thanks!! I'll check it out
10 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 8/3/2023 in #questions
Cool svg animation insight.
I've managed to do a simple animation that kinda resembles to this with an svg element and Vanilla js
<svg>
.....
<defs>
<linearGradient
id="linear-control"
x1="0"
y1="-5.21693"
x2="8.29046"
y2="90.9949"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.03125" stop-color="#525252" />
<stop offset="0.479167" stop-color="#DA2F0A" />
<stop offset="0.887721" stop-color="#1C4ECE" />
</linearGradient>
</defs>
</svg>
<svg>
.....
<defs>
<linearGradient
id="linear-control"
x1="0"
y1="-5.21693"
x2="8.29046"
y2="90.9949"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.03125" stop-color="#525252" />
<stop offset="0.479167" stop-color="#DA2F0A" />
<stop offset="0.887721" stop-color="#1C4ECE" />
</linearGradient>
</defs>
</svg>
I control the x1 attribute in linearGradient using setTimeout:
const linearControl = document.getElementById("linear-control");
let index = 0;
const increment = 10;
const delay = 100;
let direction = 1;

function animate() {
if (index > 200) {
direction = -1;
} else if (index < 0) {
direction = 1;
}

index += direction * increment;
linearControl.setAttribute("x1", index);

setTimeout(animate, delay);
}

animate();
const linearControl = document.getElementById("linear-control");
let index = 0;
const increment = 10;
const delay = 100;
let direction = 1;

function animate() {
if (index > 200) {
direction = -1;
} else if (index < 0) {
direction = 1;
}

index += direction * increment;
linearControl.setAttribute("x1", index);

setTimeout(animate, delay);
}

animate();
10 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 8/3/2023 in #questions
Cool svg animation insight.
yes it is an svg with animated gradients. The gradient part is pretty straightforward. I am curious about how do I animate the gradient.
10 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 7/26/2023 in #questions
Monitoring APIs hosted on Vercel.
Thank youuuu
4 replies
TTCTheo's Typesafe Cult
Created by jairrard on 4/7/2023 in #questions
div inside a div - preventing complex onClick event propagation
From Mozilla docs: The stopPropagation() does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the preventDefault() method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see stopImmediatePropagation().
6 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 2/19/2023 in #questions
Export a Planetscale database.
Looking at the data in planetscale can be done using the <npx prisma studio>. I wanted to be able to export the data to a format that is readable by Excel. I managed to do so by backing up my data and then dumping it on my local machine using the pscale CLI. And then load the .sql files from Excel, and then a vlookup to sort the two tables based on 'studentId'. Thanks a lot!
5 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 2/16/2023 in #questions
Type error on Vercel prod
5 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 2/16/2023 in #questions
Removing duplicate items in Planetscale
Anyway
5 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 2/16/2023 in #questions
Removing duplicate items in Planetscale
I'm not getting paid
5 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 2/16/2023 in #questions
Removing duplicate items in Planetscale
They can fill it up again
5 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 2/16/2023 in #questions
Removing duplicate items in Planetscale
Nvm I deleted the db. 200 rows of data is nothing
5 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 12/8/2022 in #questions
Hello everyone, I may need some of your front-end expertise on this one.
14 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 12/8/2022 in #questions
Hello everyone, I may need some of your front-end expertise on this one.
14 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 12/8/2022 in #questions
Hello everyone, I may need some of your front-end expertise on this one.
14 replies
TTCTheo's Typesafe Cult
Created by sumatoken on 12/8/2022 in #questions
Hello everyone, I may need some of your front-end expertise on this one.
14 replies