Skip to content

Instantly share code, notes, and snippets.

@jeffijoe
jeffijoe / app.js
Last active April 6, 2025 09:18
Streaming uploads through Koa.
import Koa from 'koa'
import parse from './busboy'
import AWS from 'aws-sdk'
const app = new Koa()
const s3 = new AWS.S3({
params: { Bucket: 'myBucket' }
})
**Jeff Escalante**
# Dato & Contentful
There are many areas in which I'd consider Dato to be much stronger of a CMS than
contentful, and one in which I'd consider the opposite to be the case. I will try to be as
balanced as possible with this overview, as I am not employed by dato or anything ‐ my
goal is to ensure that my clients and developers get the best possible experience working
with a CMS.
@joeyklee
joeyklee / mysql-setup-mac-with-sequel-pro.md
Last active November 17, 2023 05:27
Setting up mysql on mac with sequel pro and homebrew

Setup instructions

Setting up mysql on mac with sequel pro and homebrew

MacOS high sierra 10.13.6
Homebrew version 1.7.6

Assuming you've installed homebrew...

WebApp Rendering Strategies 2019

Client Side Rendering

Tooling: Hyperapp, Mithril, React, Vue

Pros

  • Dynamic Routing. There's no refresh when routing between pages.

Cons

  • JavaScript must be downloaded before the page can begin to render, slowing down first paint performance.[1]

You don't need CORS Middleware 2019

A node example using Zeit's Micro.

const micro = require('micro')

const server = micro(async (request, response) => {
 // set response headers
@bradtraversy
bradtraversy / vscode_shortcuts.md
Last active November 15, 2025 02:37
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active November 20, 2025 12:39
Building a react native app in WSL2
@sindresorhus
sindresorhus / esm-package.md
Last active November 25, 2025 17:53
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@meotimdihia
meotimdihia / How to fix the bug: "Warning: Expected server HTML to contain a matching <div> in <div>." in Next.js.md
Last active December 21, 2022 10:01
How to fix the bug: "Warning: Expected server HTML to contain a matching <div> in <div>." in Next.js

1 Easy but re-render

most simple way, but it will re-render. It may be related to the scrolling restoration bug when the user return the page if your data is fetched on the client

import {useState, useEffect} from 'react'

export default function Index() {
  const [mounted, setMounted] = useState(false);
  useEffect(() => {
      setMounted(true)