blog icon indicating copy to clipboard operation
blog copied to clipboard

🍁 What you don't know is what you haven't learned

Results 195 blog issues
Sort by recently updated
recently updated
newest added

Use [debounce](https://www.geeksforgeeks.org/lodash-_-debounce-method/) from `lodash` and [useCallback](https://react.dev/reference/react/useCallback) to memoize debounce function ```ts import React, { useCallback } from "react" import debounce from "lodash/debounce" const SearchField = (props: Props) => { const...

javascript
react

Use ES6 [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) > The Map object holds key-value pairs and remembers the original insertion order of the keys. Any value (both objects and [primitive values](https://developer.mozilla.org/en-US/docs/Glossary/Primitive)) may be used as...

javascript

Create a custom `NSView` that handles `mouseDragged` to `beginDraggingSession` ```swift struct DraggingSourceViewWrapper: NSViewRepresentable { let fileUrls: [URL] let onEnd: () -> Void func makeNSView(context: Context) -> DraggingSourceView { let view...

macOS
swiftUI

iOS 17 has a new Stand by mode so SwiftUI introduces `containerBackground` for the system to decide when to draw background. It also automatically applies margin to widget so we...

iOS
swift
swiftUI

I prefer UI Component that works with Nextjs and Tailwind CSS ## UI Libraries - https://ui.shadcn.com/ - https://daisyui.com/ - https://www.radix-ui.com/ 👍 - https://preline.co/ - https://nextui.org/ - https://mantine.dev/ - https://chakra-ui.com/ -...

web

Inspired by [shadcn](https://github.com/shadcn-ui/ui/blob/main/apps/www/lib/utils.ts#L4) Combine - [tailwind-merge](https://www.npmjs.com/package/tailwind-merge): Utility function to efficiently merge [Tailwind CSS](https://tailwindcss.com/) classes in JS without style conflicts. - [clsx](https://www.npmjs.com/package/clsx): constructing className strings conditionally. ```ts import { clsx, type...

javascript
css

AppStorage and SceneStorage accepts RawRepresentable where value is Int or String. > Creates a property that can read and write to a string user default, transforming that to RawRepresentable data...

swift
swiftUI

### Creating a new gist - Go to https://gist.github.com/ and create a new gist - Note that you need to include `filename` + `extension` to enable automatic language markup -...

Need to set target ```swift let item = NSMenuItem( title: title, action: #selector(onMenuItemClicked(_:)), keyEquivalent: "" ) item.target = self ``` Sometimes, need to check `autoenablesItems` > Indicates whether the menu...

swift
macOS

Sometimes Row Level Security is not enough and we want to do all logic server side, then we need a way for the server to get hold onto current user...

react
web