Skip to content

Instantly share code, notes, and snippets.

View saiashirwad's full-sized avatar
🏠
Working from home

texoport saiashirwad

🏠
Working from home
View GitHub Profile
@jjhiggz
jjhiggz / how-to-use.md
Last active October 23, 2025 03:33
Prisma Effect Generator

Prisma Effect Generator

  1. Put the above prisma-effect-generator.ts in your root of your project.

  2. Install "@prisma/generator-helper" and "@prisma/internals" as dev dependecies.

  3. Add this to your schema.prisma file

generator sqlSchema {
@qexat
qexat / jekyll_idea.md
Last active May 15, 2025 19:41
jekyll: a hyper-declarative, statically-typed programming language around environment manipulation

jekyll: a hyper-declarative, statically-typed programming language around environment manipulation

# x is introduced to the environment
{ ..?e } → { x := 3 ; ..?e }
# y too ; ?e is not the same row variable as the one above
{ ..?e } → { y := 5 ; ..?e }
# matching the current context on one that contains an x and a y
# which allows us to add them to introduce y
{ x ; y ; ..?e } → { z := x + y ; ..?e } 
@kr-alt
kr-alt / tsgo.lua
Created March 12, 2025 16:12
lsp config to test out the new tsgo LSP
local function start_tsgo()
local root_files = { "tsconfig.json", "jsconfig.json", "package.json", ".git" }
local paths = vim.fs.find(root_files, { stop = vim.env.HOME })
local root_dir = vim.fs.dirname(paths[1])
if root_dir == nil then
-- root directory was not found
return
end
@OrionReed
OrionReed / dom3d.js
Last active November 16, 2025 19:47
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@veekaybee
veekaybee / normcore-llm.md
Last active November 16, 2025 04:22
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@rphlmr
rphlmr / clear-db.ts
Last active August 24, 2025 11:07
Drizzle snippets
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406
import { sql } from "drizzle-orm";
const clearDb = async (): Promise<void> => {
const query = sql<string>`SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_type = 'BASE TABLE';
`;
@lawrencecchen
lawrencecchen / kyselyAdapter.ts
Last active February 10, 2023 10:04
next-auth kysely adapter
import type { Kysely, RawBuilder } from "kysely";
import type { Account } from "next-auth";
import type {
Adapter,
AdapterSession,
VerificationToken,
AdapterUser,
} from "next-auth/adapters";
import type { DB } from "shared";
@MasoodGit
MasoodGit / keybindings.json
Last active October 11, 2025 12:57
vscode vim keybindings and settings.json
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+h",
"command": "workbench.action.focusLeftGroup",
"when": "editorTextFocus && vim.active && vim.mode != 'Insert'"
},
{
"key": "ctrl+l",
"command": "workbench.action.focusRightGroup",

JavaScript Interview Questions

Q1: Explain equality in JavaScript ☆

Answer: JavaScript has both strict and type–converting comparisons:

  • Strict comparison (e.g., ===) checks for value equality without allowing coercion
  • Abstract comparison (e.g. ==) checks for value equality with coercion allowed

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com