Skip to content

Instantly share code, notes, and snippets.

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

Aadarsha Acharya adarshaacharya

🏠
Working from home
View GitHub Profile
@jerriclynsjohn
jerriclynsjohn / settings.json
Created September 8, 2023 14:47
.vscode settings
{
// Custom Typings for Next 13
"typescript.tsdk": "node_modules/typescript/lib",
// For Prettier
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.requireConfig": true,
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active May 5, 2024 15:12
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@sahilmore-git
sahilmore-git / json_stringify_polyfill.js
Last active August 7, 2022 17:46
Polyfill for JSON.stringify
function stringify(data) {
if (data === undefined)
return undefined
if (data === null)
return 'null'
if (data.toString() === "NaN")
return 'null'
if (data === Infinity)
return 'null'
if (data.constructor === String)
@judaew
judaew / keychron_k2.adoc
Last active May 4, 2024 11:15
Keychron K2 Manual

Keychron K2 Manual

Connect Bluetooth

On the side of the keyboard, switch the toggle to Bluetooth. Press fn+1 3 seconds and pair with device named Keychron K2.

  • fn+1 connect to 1st device

  • fn+2 connect to 2nd device

  • fn+3 connect to 3rd device

@tinnet
tinnet / gist:1343179
Created November 6, 2011 17:02
anti-mongodb rant (mirror from pastebin)
Don't use MongoDB
=================
I've kept quiet for awhile for various political reasons, but I now
feel a kind of social responsibility to deter people from banking
their business on MongoDB.
Our team did serious load on MongoDB on a large (10s of millions
of users, high profile company) userbase, expecting, from early good
experiences, that the long-term scalability benefits touted by 10gen