This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function buildPrismaWithQueryDebugging( | |
sqlQueryReportingThresholdMs: number, | |
prismaActionReportingThresholdMs: number | |
) { | |
const prisma = new PrismaClient({ | |
log: [ | |
{ | |
emit: "event", | |
level: "query", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use client" | |
import { forwardRef, useState } from "react" | |
import { EyeIcon, EyeOffIcon } from "lucide-react" | |
import { Button } from "@/components/ui/button" | |
import { Input, InputProps } from "@/components/ui/input" | |
import { cn } from "@/lib/utils" | |
const PasswordInput = forwardRef<HTMLInputElement, InputProps>( | |
({ className, ...props }, ref) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
observeKeyboardWillShowNotification(scrollView) { [weak self] keyboardSize in | |
guard let keyboardHeight = keyboardSize?.height else { return } | |
self?.someViewYouWantToMoveBottomConstraint?.constant = -keyboardHeight | |
} | |
observeKeyboardWillHideNotification(scrollView) { [weak self] _ in | |
self?.someViewYouWantToMoveBottomConstraint?.constant = .zero | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol ScrollableContentKeyboardObserving { | |
func observeKeyboardWillShowNotification(_ scrollView: UIScrollView, onShowHandler onShow: ((CGSize?) -> Void)?) | |
func observeKeyboardWillHideNotification(_ scrollView: UIScrollView, onHideHandler onHide: ((CGSize?) -> Void)?) | |
} | |
extension ScrollableContentKeyboardObserving { | |
func observeKeyboardWillShowNotification(_ scrollView: UIScrollView, onShowHandler onShow: ((CGSize?) -> Void)? = nil) { | |
let block: (Notification) -> Void = { notification -> Void in | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NSError { | |
/// A convenience initializer for NSError to set its description. | |
/// | |
/// - Parameters: | |
/// - domain: The error domain. | |
/// - code: The error code. | |
/// - description: Some description for this error. | |
convenience init(domain: String, code: Int, description: String) { | |
self.init(domain: domain, code: code, userInfo: [(kCFErrorLocalizedDescriptionKey as CFString) as String: description]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android | |
on: [push] | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Collection { | |
subscript(index i : Index) -> Element? { | |
return indices.contains(i) ? self[i] : nil | |
} | |
} | |
sliceOfArray[index: 0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if array.indices.contains(3) { | |
print (array[3]) | |
} |
NewerOlder