Skip to content

Instantly share code, notes, and snippets.

View allipiopereira's full-sized avatar

alipioUser0 allipiopereira

View GitHub Profile
@allipiopereira
allipiopereira / starship.toml
Created July 1, 2024 09:13
My Starship terminal configuration file | Inspired by Vesper Theme
#format = """
#[┣─system─❯](bold white) $hostname
#[┣─project❯](bold #FF8080) $directory$rust$git_branch$git_status$package$golang$terraform$docker_context$python$docker_context$nodejs
#[╰─cmd────❯](bold green)
#"""
[hostname]
ssh_only = false
format = '[$hostname](bold #FFC799) '
trim_at = "."
create or replace function update_profile () returns trigger security definer language plpgsql as $$
begin
update public.profiles
set email = new.email
where id = new.id;
return new;
end;
$$;
create trigger update_profile_trigger
@allipiopereira
allipiopereira / gist:d7b01632d865e82e85c926e4d5772b14
Created January 22, 2024 15:03
policies users table - Auth Supabase
create policy "Public notes are viewable by everyone." on users
for select using (true);
create policy "Users can insert their own notes." on users
for insert with check (auth.uid() = id);
create policy "Users can update their own notes." on users
for update using (auth.uid() = id);
-- Policy to allow users to delete their own notes
@allipiopereira
allipiopereira / gist:6f11e427b671856252cb94f8661f997e
Created January 7, 2024 21:01
Como criar Subusários com Firebase - Permitir que um usuário crie outro usuário
import * as functions from "firebase-functions";
import * as admin from "firebase-admin";
const db = admin.firestore();
// Callable funciton to create a user
export const functionCreateUser = functions.https.onCall(
async (data, context) => {
var firebaseError = "";
console.log(
"function was called by user with id : " + context.auth?.uid || null
Quero fazer uma api para autenticacao utilizando jwt, mas não estou conseguindo acho que misturei coockie com jwt
Estou usando a versao 5 do ADONIS