Skip to content

Instantly share code, notes, and snippets.

View dmcardoso's full-sized avatar
🚀
Launching

Daniel Cardoso dmcardoso

🚀
Launching
View GitHub Profile
#!/bin/bash
# find ./src/processos -iname "*auctioneer*" -exec ./rename-everything.sh {} \;
OLD_FILE=$1
ORIGINAL_MODULE="auctioneer"
NEW_MODULE="processo"
echo "path: " $OLD_FILE
redis-cli -h <host> -p <port> -a <senha>
@dmcardoso
dmcardoso / crlf-lf
Created January 25, 2021 19:34 — forked from eduardofx/crlf-lf
changed all files from CRLF to LF - Windows x Linux
git config core.autocrlf false
git rm --cached -r . // dont forget the dot at the end
git reset --hard
#!/usr/bin/env bash
```
# Less than 100mb
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME
# More than 100mb
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt
```

Ouvir microfone no linux

arecord | aplay

Executar para verificar o nome da câmera

dmesg | grep uvcvideo

Ligar

sudo modprobe uvcvideo
@dmcardoso
dmcardoso / colors.md
Created March 24, 2020 10:52 — forked from 0x263b/colors.md
Random color from string in javascript

Random color from string in javascript

Consider a list of strings you need to permanently assign a random color.

First you should turn the string into a hash.

var string = "string"
var hash = 0

Ferramentas citadas no podcast da rocketseat

  • Open api
  • RAML
  • Stoplight
  • Swagger

Para documentações mais técnicas utilizar:

  • Postman
  • Insomnia
import { useEffect } from 'react';
function useClickOutside(refs, callback) {
function handleClickOutside(event) {
refs = Array.isArray(refs) ? refs : [refs];
const mountedRefs = refs.every((ref) => !!ref.current);
if (mountedRefs) {
const isSomeRef = refs.every(
(ref) => !ref.current.contains(event.target)

SSH config shorthand

Para editar o ssh config

vim ~/.ssh/config

Host apelido
	User root
	HostName ip
	Port 22300