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
  • 22:51 (UTC -03:00)
View GitHub Profile
@marlosirapuan
marlosirapuan / gist:778d6beda5f8ab95695748011c864b19
Last active April 26, 2024 17:15
Download .m3u8 files on MacOS

Install ffmpeg

brew install ffmpeg

Download file through url, like this:

ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "http://url-file.domain.m3u8" -c copy video.mp4
@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 / 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 / 🎵 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
@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 / mime.types
Last active September 11, 2023 16:51
NGINX Config - Content-Security-Policy (Google, Google Fonts, Facebook, Zendesk, MaxCDN-FontAwesome, CKEditor), Cache, Mime-Types, Puma
# /etc/nginx/mime.types
types {
font/ttf ttf;
font/opentype otf;
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
@marlosirapuan
marlosirapuan / bulma_breadcrumbs_builder.rb
Last active May 22, 2023 20:47 — forked from SaladFork/bootstrap4_breadcrumbs_builder.rb
`breadcrumbs_on_rails` builder with Bulma compatible output
# `BulmaBreadcrumbsBuilder `is a Bulma compatible breadcrumb
# builder. It is designed to work with the `breadcrumbs_on_rails` gem as a
# drop-in builder replacement.
#
# BulmaBreadcrumbsBuilder accepts a limited set of options:
#
# | option | default | description |
# | ---------------- | ------- | ------------------------------------------ |
# | `:container_tag` | `:ol` | What tag to use for the list container |
# | `:tag` | `:li` | What HTML tag to use for breadcrumb items |
@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"