start new:
tmux
start new with session name:
tmux new -s myname
| // Check if rectangle a contains rectangle b | |
| // Each object (a and b) should have 2 properties to represent the | |
| // top-left corner (x1, y1) and 2 for the bottom-right corner (x2, y2). | |
| function contains(a, b) { | |
| return !( | |
| b.x1 < a.x1 || | |
| b.y1 < a.y1 || | |
| b.x2 > a.x2 || | |
| b.y2 > a.y2 | |
| ); |
| OBS: O var_number_int é a varável que recebera o valor a ser convertido em DP | |
| (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, var_number_int, getResources().getDisplayMetrics()) | |
| ##KOTLIN | |
| val Int.dp: Int | |
| get() = (this * Resources.getSystem().displayMetrics.density + 0.5f).toInt() | |
| val Float.dp: Int |
Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
| export default function createCrudHooks({ | |
| baseKey, | |
| indexFn, | |
| singleFn, | |
| createFn, | |
| updateFn, | |
| deleteFn, | |
| }) { | |
| const useIndex = (config) => useQuery([baseKey], indexFn, config) | |
| const useSingle = (id, config) => |
| import React, { useEffect, useMemo, useCallback, useLayoutEffect, useState } from "react"; | |
| import { EditorView } from "@codemirror/view"; | |
| import { EditorState, Compartment, EditorStateConfig, StateEffect, Extension } from "@codemirror/state"; | |
| import { indentUnit } from "@codemirror/language"; | |
| /** creates an editor view from an initial state - destroys the view on cleanup */ | |
| export function useEditorView(initState: (() => EditorStateConfig) | EditorStateConfig = {}): EditorView { | |
| const view = useMemo( | |
| () => new EditorView({ state: EditorState.create(typeof initState === "function" ? initState() : initState) }), | |
| [] |
| const Recipient = require('mailersend').Recipient; | |
| const EmailParams = require('mailersend').EmailParams; | |
| const BulkEmails = require('mailersend').BulkEmails; | |
| const MailerSend = require('mailersend'); | |
| const users = require('./users'); | |
| const MAILERSEND_API_KEY = process.env.MAILERSEND_API_KEY; | |
| if (!MAILERSEND_API_KEY) { | |
| console.error('MAILERSEND_API_KEY is required'); |
| // | |
| // ContentView.swift | |
| // FetchAsync | |
| // | |
| // Created by Gabriel Zawalski on 09/11/23. | |
| // | |
| import SwiftUI | |
| struct ContentView: View { |
| import { AnyZodObject, z } from 'zod' | |
| import { Metadata, ResolvingMetadata } from 'next' | |
| type InferParams<Params> = Params extends readonly string[] | |
| ? { | |
| [K in Params[number]]: string | |
| } | |
| : Params extends AnyZodObject | |
| ? z.infer<Params> | |
| : unknown |