Skip to content

Instantly share code, notes, and snippets.

View dfana01's full-sized avatar

Dante dfana01

View GitHub Profile
@dfana01
dfana01 / stableDiffusion.jsx
Created March 29, 2024 21:15
Code snippet is a simple React Native implementation designed to utilize the Stability AI's Stable Diffusion API to generate images based on text prompts using Mutation and fetch.
import { useMutation } from 'react-query';
import { QueryClient } from 'react-query';
import * as FileSystem from 'expo-file-system';
import { Buffer } from 'buffer';
import { nanoid } from 'nanoid';
export interface Request {
text_prompts: { text: string }[];
cfg_scale?: number;
steps?: number;
import os # Import the os module for file operations
import PyPDF2 as PyPDF2 # Import the PyPDF2 module for PDF operations
# List of Amazon order IDs and tracking numbers
amazon_order_id_and_tracking_number = [
"<amazon_order>|<tracking_number>",
]
# Directory where the proof of exportation PDF files are stored
directory = "../proof-of-exportation"
# Function to look for a proof of exportation file with a given tracking number
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfana01
dfana01 / formula-validator.py
Last active October 13, 2020 03:42
Prueba Práctica de Desarrollo I - Análisis Sintáctico de Fórmulas Proposicionales
'''
Methods used to validate and tokenize the formulas enter by the user.
'''
VALID_OPERATORS = ['∧','∨','→']
VALID_PROPORTIONAL_VARIABLES = [
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
]
@dfana01
dfana01 / downloader.py
Created April 26, 2018 21:05
Download several images with python
#!/usr/bin/env python
"""
downloader.py: A simple python images downloader, this use a simple list and download every item from a http uri.
"""
__author__ = "Dante Faña Badia <dfana@dfb.com.do>"
__copyright__ = "Copyright 2018, Dante Faña Badia"
__license__ = "GPL"
__version__ = "1.0.0"