Skip to content

Instantly share code, notes, and snippets.

View anselmoalima's full-sized avatar
🏠
Working from home

Anselmo A. Lima anselmoalima

🏠
Working from home
View GitHub Profile
@anselmoalima
anselmoalima / magic-fetch.js
Created October 13, 2023 18:25
Magic Fetch Examples
import { BadRequestError, MagicError, NotFoundError } from '@magic/api/trpc';
const client_id = 'c1ec3e33-5959-4157-9c51-d54f7d0f7c02';
const client_secret = 'c1ec3e33-5959-4157-9c51-d54f7d0f7c02';
const getCode = async () => {
const redirect_uri = 'http://localhost:3001/leads';
const baseURL = `https://api.rd.services/auth/dialog?client_id=${client_id}&redirect_uri=${redirect_uri}`;
try {
@anselmoalima
anselmoalima / multiple-ssh-keys-git.adoc
Created July 3, 2023 21:16 — forked from alejandro-martin/multiple-ssh-keys-git.adoc
Configure multiple SSH Keys for Git

Use Multiple SSH Keys for Git host websites (Github, Gitlab)

This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.

Creating SSH keys

  1. Create SSH directory:

@anselmoalima
anselmoalima / a-mongodb-replica-set-docker-compose-readme.md
Created July 30, 2021 01:51 — forked from harveyconnor/a-mongodb-replica-set-docker-compose-readme.md
MongoDB Replica Set / docker-compose / mongoose transaction with persistent volume

This will guide you through setting up a replica set in a docker environment using.

  • Docker Compose
  • MongoDB Replica Sets
  • Mongoose
  • Mongoose Transactions

Thanks to https://gist.github.com/asoorm for helping with their docker-compose file!

@anselmoalima
anselmoalima / image-preview.jsx
Created July 28, 2020 19:48
Image Preview Before Upload
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
$('#blah').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]); // convert to base64 string
}