Skip to content

Instantly share code, notes, and snippets.

View marlosirapuan's full-sized avatar
🏖️
Working from home

Marlos marlosirapuan

🏖️
Working from home
  • João Pessoa, PB - Brazil
  • 01:42 (UTC -03:00)
View GitHub Profile
@marlosirapuan
marlosirapuan / .macos
Last active September 18, 2024 18:16
dotfiles mac os sequoia
#!/usr/bin/env bash
# References:
https://mac.install.guide/mac-setup/
https://medium.com/@laclementine/dotfile-for-mac-efe082ad0d6a
https://github.com/mathiasbynens/dotfiles/blob/main/.macos
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
@marlosirapuan
marlosirapuan / how_install.md
Created September 7, 2024 12:34
install ruby 2.7.8 on mac m1 with mise
@marlosirapuan
marlosirapuan / README.md
Created May 14, 2024 16:12 — forked from julienma/README.md
GitHub Actions: using SSH keys to auto-deploy with dokku-push

The dokku-push action requires an SSH key with push access to the Dokku instance. Here's how to do that.

Replace APPNAME with the name of the app (e.g. this is a good idea to use the same name used on Dokku's).

Generate a new SSH keypair

We want each repo to have its own SSH key, so it's easier to rotate/invalidate them if required, without affecting all the repos. Let's generate a new key on your computer (see GitHub help):

@marlosirapuan
marlosirapuan / nord-deep.yaml
Last active April 18, 2024 19:24
Nord Deep (Warp Terminal)
# ~/.warp/themes/
accent: '#81A1C1'
background: '#111111'
details: darker
foreground: '#D8DEE9'
terminal_colors:
bright:
black: '#4C566A'
blue: '#81A1C1'
@marlosirapuan
marlosirapuan / money-input.tsx
Created December 26, 2023 12:08
Money Input for Mantine UI
// calc values divided by 100, ex:
// defaultValue={item.price / 100}
// values.item.price / 100
import { forwardRef } from 'react'
import { CurrencyInput, ICurrencyMaskProps } from 'react-currency-mask'
import { MantineSize, TextInput, TextInputProps } from '@mantine/core'
type MoneyInputComponentProps = ICurrencyMaskProps &
@marlosirapuan
marlosirapuan / app-context.ts
Created August 31, 2023 18:09
Context App Provider with zustand in Typescript
import { createContext, useContext } from 'react'
import { createStore, StoreApi } from 'zustand'
import { immer } from 'zustand/middleware/immer'
import { useStoreWithEqualityFn } from 'zustand/traditional'
type State = {
total: number
increase: () => void
decrease: () => void
@marlosirapuan
marlosirapuan / ApolloClient.ts
Created July 19, 2022 21:11 — forked from RobinDaugherty/ApolloClient.ts
Apollo client setup with ActionCable using TypeScript
import ActionCable from 'actioncable';
import { ActionCableLink } from 'graphql-ruby-client';
import { ApolloClient } from "apollo-client";
import { ApolloLink, Operation } from "apollo-link";
import { DefinitionNode, OperationDefinitionNode } from 'graphql';
import { RetryLink } from "apollo-link-retry";
import { createHttpLink } from "apollo-link-http";
import { InMemoryCache } from "apollo-cache-inmemory";
import { onError } from "apollo-link-error";
@marlosirapuan
marlosirapuan / file-upload.tsx
Created April 30, 2021 18:18 — forked from Sqvall/file-upload.tsx
File Upload with Chakra UI and react-hook-form
import { ReactNode, useRef } from 'react'
import { Button, FormControl, FormErrorMessage, FormLabel, Icon, InputGroup } from '@chakra-ui/react'
import { useForm, UseFormRegisterReturn } from 'react-hook-form'
import { FiFile } from 'react-icons/fi'
type FileUploadProps = {
register: UseFormRegisterReturn
accept?: string
multiple?: boolean
children?: ReactNode
import ApolloClient, { FetchPolicy } from "apollo-client"
import { HttpLink } from "apollo-link-http"
import { InMemoryCache, NormalizedCacheObject } from "apollo-cache-inmemory"
// import { setContext } from "apollo-link-context"
import ActionCable from "action-cable-react-jwt"
import ActionCableLink from "graphql-ruby-client/dist/subscriptions/ActionCableLink"
import { ApolloLink } from "apollo-link"
import { handleAuthentication, refreshToken } from "utils/oauth"
import { Observable } from "apollo-link"
import { onError } from "apollo-link-error"
@marlosirapuan
marlosirapuan / 🎵 My last week in music
Last active January 6, 2024 15:01
🎵 My last week in music
Dream Theater ██████▌░░░░░░░░░░ 25 plays
Cradle of Filth ███▉░░░░░░░░░░░░░ 15 plays
Blind Guardian ██▎░░░░░░░░░░░░░░ 9 plays
Madder Mortem ▊░░░░░░░░░░░░░░░░ 3 plays
Redemption ▊░░░░░░░░░░░░░░░░ 3 plays
Ayreon ▌░░░░░░░░░░░░░░░░ 2 plays
Caligula's Horse ▌░░░░░░░░░░░░░░░░ 2 plays
Firewind ▌░░░░░░░░░░░░░░░░ 2 plays
Haken ▌░░░░░░░░░░░░░░░░ 2 plays
Porcupine Tree ▌░░░░░░░░░░░░░░░░ 2 plays