Skip to content

Instantly share code, notes, and snippets.

@jalvarado91
jalvarado91 / expand_sd_prompt.txt
Created October 24, 2023 22:08
Expand SD Prompt
You are good at describing pictures in words. I will give you a short scene description. You can use appropriate words to describe the surrounding environment, picture style, light, perspective, the appearance of the subject, etc. Don't show keywords that are not related to the description, Use as many words as possible to describe the picture, but no more than 65 tokens.
### Instruction: a girl is in the garden
### Response: a beautiful young girl in a pink dress sitting on a bench in a flower garden, she have long hair and bright eyes, smiled, Sunny weather and blue sky, Wide-angle, cinematic lighting, film tone, warm background.
### Instruction: A beautiful witch
### Response: A beautiful young witch with long silver hair and piercing green eyes, standing in front of a large stone castle, surrounded by lush greenery and blooming flowers, the sun shining down on her, Wide-angle shot, cinematic lighting, cool color tone.
### Instruction:
@jalvarado91
jalvarado91 / ai_function.py
Created April 4, 2023 14:08
Ai Function with OpenAI API
import openai
def ai_function(function, args, description, model = "gpt-3.5-turbo"):
"""
function = "def fake_people(n: int) -> list[dict]:"
args = ["4"]
description_string = \"""Generates n examples of fake data representing people, each with a name and an age.\"""
result = ai_function(function_string, args, description_string, model)
"""
{"v":1,"name":"Tests","folders":[],"requests":[{"v":"1","endpoint":"http://localhost:3001/login","name":"Get Users","params":[],"headers":[],"method":"GET","auth":{"authType":"none","authActive":true,"addTo":"Headers","key":"","value":""},"preRequestScript":"","testScript":"","body":{"contentType":"application/json","body":"{\n \"email\": \"admin@test.com\",\n \"password\": \"password\"\n}"}},{"v":"1","endpoint":"http://localhost:3001/login","name":"Create User","params":[],"headers":[],"method":"POST","auth":{"authType":"none","authActive":true,"addTo":"Headers","key":"","value":""},"preRequestScript":"","testScript":"","body":{"contentType":"application/json","body":"{\n \"email\": \"admin@test.com\",\n \"password\": \"password\"\n}"}}]}
@jalvarado91
jalvarado91 / mbp_to_anne_pro_2_arrows.json
Last active May 18, 2020 19:57
Karabiner Elements MBP to Anne Pro 2 Arror Keys
{
"title": "MBP to Anne Pro 2 Arror Keys",
"rules": [
{
"description": "Caps+ijkl or Caps+wasd for arrows",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "s",
type Player = "Boot" | "Battleship" | "Iron";
type Color = "Brown" | "Magenta" | "LightBlue";
type Houses = { count: number };
type Development = "Empty" | Houses | "Hotel";
// type TileTypes = "Street" | "Utility" | "Tax" | "Station";
/*
Author: Juan Alvarado
Panther ID: 3367805
Description: Write a C program that sorts the lines of some input
Usage: bstsort [-c] [-o output_file_name] [input_file_name]
Originality: I affirm that this program is entirely my own work and
none of it is the work of any other person
*/
#include <stdio.h>
@jalvarado91
jalvarado91 / mshell.c
Created April 23, 2017 03:43
A shell son
#include <stdio.h>
#include <sys/wait.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/errno.h>
#include <sys/types.h>
#include <fcntl.h>
#define MAX_ARGS 20
\documentclass[12pt]{article}
\usepackage{fullpage}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}
\begin{document}
\title{Homework 1}
\author{Juan Alvarado}
@jalvarado91
jalvarado91 / HttpUtil.java
Last active September 15, 2017 13:46
Ok Http Callback Wrap
package com.example.jalvarado.mlsview.utils;
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
import java.io.IOException;
<?php
include_once("../config.php");
include_once("resizeimage.php");
error_reporting(E_ALL);
$user_id = $_SESSION['account'][0]->id;
$id = intval($_POST['id']);
$type = $_POST['type']; //listing //condo //community //timeline
$standard_width = 1280;
$ratio = .70;