Skip to content

Instantly share code, notes, and snippets.

View adeleke5140's full-sized avatar
💭
crafting software

Kehinde adeleke5140

💭
crafting software
View GitHub Profile
@rain-1
rain-1 / base model trends.md
Last active October 19, 2025 08:19
base model trends.md
@t3dotgg
t3dotgg / try-catch.ts
Last active October 26, 2025 18:39
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@biast12
biast12 / Replace-twitter-logo.user.js
Last active May 17, 2024 17:35
Replaces the X logo with the old Twitter logo
// ==UserScript==
// @name Replaces the X logo with the old Twitter logo
// @description Replaces the X logo with the old Twitter logo by Biast12
// @icon https://abs.twimg.com/favicons/twitter.ico
// @version 1.0.6
// @author Biast12
// @namespace https://twitter.com/Biast12
// @homepageURL https://gist.github.com/biast12/04f66af3297b9395ec489f7eb16a9286
// @supportURL https://gist.github.com/biast12/04f66af3297b9395ec489f7eb16a9286
// @updateURL https://gist.github.com/biast12/04f66af3297b9395ec489f7eb16a9286/raw/Replace-twitter-logo.user.js
@yinkakun
yinkakun / axios.ts
Last active February 6, 2025 09:26
next client auth with zustand, axios
import Axios from "axios";
import Router from "next/router";
const API_URL = process.env.NEXT_PUBLIC_API_URL;
export const axios = Axios.create({
baseURL: API_URL,
headers: {
"Content-Type": "application/json",
},
@arinze19
arinze19 / remote-work-resources.md
Last active September 20, 2024 09:35
Remote Work Resources

Having worked remotely for the majority of my career, I've come to settle on this way of working and gathered a few resources that have helped me stay productive. Below I've shared some resources for people looking to transition into remote work or existing workers looking to improve their productivity. Please feel free to open up a PR and add more resources of your own.

Focusing

For the most part, focusing was something I struggled with since I was working out of my bedroom and any time I felt tired I could easily retire to my bed and spend a large chunk of time being unproductive. I counter-acted these habitts with some of the following tools

  1. FocusMate - Productivity web application to enable you do deep work by pairing you with an accountability partner over video for a session of deep and focused work.
    • Free Plan: Limited to 3 sessions per week
  • Paid Plan: Unlimited number of sessions a week
@adeleke5140
adeleke5140 / cons.js
Created January 27, 2023 23:22 — forked from abiodun0/cons.js
For next blog post con cdr car
const cons = (x, y) => (m) => m(x, y)
const car = (z) => z((p, q) => p)
const cdr = (z) => z((p, q) => q)
const someLinkedList = cons(1, cons(2, cons(3 , null)))
// iterating
@roshanlabh
roshanlabh / react-phone-book.js
Created January 24, 2021 13:10
Coderbyte - React Phone Book [solution]
import React, { useState } from "react";
import ReactDOM from "react-dom";
const style = {
table: {
borderCollapse: "collapse",
},
tableCell: {
border: "1px solid gray",
margin: 0,
import * as React from "react";
import { useMousePosition } from "~/hooks/useMousePosition";
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) {
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {};
const [mouseX, mouseY] = useMousePosition();
const positions = { x, y, h, w, mouseX, mouseY };
return (
<div
@laurenzcodes
laurenzcodes / link.tsx
Last active January 12, 2023 17:42
Gatsby Link Component that preserves url parameters after route change
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active October 27, 2025 13:38
Conventional Commits Cheatsheet