Skip to content

Instantly share code, notes, and snippets.

View AguacateVelarde's full-sized avatar
:octocat:
Building the new digital world

Leonardo Velarde AguacateVelarde

:octocat:
Building the new digital world
View GitHub Profile
@AguacateVelarde
AguacateVelarde / App.jsx
Last active November 28, 2023 20:17
Propaga SDK integration
import { useState } from 'react';
import { StyleSheet, View, Button } from 'react-native';
import { usePropaga } from '@propaga/react-native-sdk';
export default function App() {
const [isPropagaActive, setIsPropagaActive] = useState(false);
const {
startPropaga,
PropagaPaymentComponent,
loaded,
@AguacateVelarde
AguacateVelarde / frontend.js
Created June 12, 2023 23:39
Abort signal with yield propagated to backend
(async () => {
const controller = new AbortController();
const signal = controller.signal;
const response = await fetch('http://127.0.0.1:8000/hi', { signal });
const reader = response.body.getReader()
while (true) {
@AguacateVelarde
AguacateVelarde / index.js
Created June 12, 2023 19:42
Abort controller simple example
const controller = new AbortController();
const signal = controller.signal;
const response = await fetch(
`https://jsonplaceholder.typicode.com/posts/${value}`,
{ signal }
);
const abortRequest = () => controller.abort();
@AguacateVelarde
AguacateVelarde / Ubuntu 16.04
Created October 10, 2022 02:15 — forked from dhoeric/Ubuntu 16.04
install-docker-aws-ec2-user-data
#!/bin/bash
# Install docker
apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt-get update
@AguacateVelarde
AguacateVelarde / rw_ro_access.sql
Created October 1, 2022 16:46 — forked from checco/rw_ro_access.sql
How to create a read only user in AWS RDS PostgreSQL and a user with superuser privileges on AWS RDS PostgreSQL
--
-- Read only
--
-- Create a group
CREATE ROLE postgres_ro_group;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO postgres_ro_group;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgres_ro_group;
const assert = require("assert");
function sortingNumbers(list = []) {
assert(list);
let currentActiveNumber = Number.MIN_SAFE_INTEGER;
return list.reduce((accumulator, current) => {
if (currentActiveNumber < current) {
accumulator.push(current);
currentActiveNumber = current;