Skip to content

Instantly share code, notes, and snippets.

View schneiderfelipe's full-sized avatar
🎯
Focusing

Felipe S. S. Schneider schneiderfelipe

🎯
Focusing
View GitHub Profile
@jart
jart / rename-pictures.sh
Created December 12, 2023 15:24
Shell script for renaming all images in a folder
#!/bin/sh
# rename-pictures.sh
# Author: Justine Tunney <jtunney@gmail.com>
# License: Apache 2.0
#
# This shell script can be used to ensure all the images in a folder
# have good descriptive filenames that are written in English. It's
# based on the Mistral 7b and LLaVA v1.5 models.
#
# For example, the following command:
@eslof
eslof / build_function.php
Last active July 16, 2023 16:13
build gpt 0613 typescript function definition from openai spec php array
function generateTypeScript($dummy): string {
$output = "// " . $dummy['description'] . "\n";
$output .= "type " . $dummy['name'] . " = (_: {\n";
$output .= generateProperties($dummy['parameters']['properties'], $dummy['parameters']['required'], false);
$output .= "}) => any;\n";
return $output;
}
function generateProperties($properties, $required, $indent): string {
$output = '';
@sebastiancarlos
sebastiancarlos / color-bind.sh
Last active August 23, 2023 12:03
Custom version of "bind -V" and "bind -P" with table output and color
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/shorts/9dU44VdoGIo
# custom bind
# - color and table formatting for "-V" and "-P"
# - if using vi mode, print both "normal" and "insert" keybindings
# - print keybindings for all keymaps if "-a" is present
function bind () {
if [[ "$#" == 1 && "$1" == "-V" ]]; then
@danielgross
danielgross / mathpix2gpt.py
Last active June 14, 2024 18:03
mathpix2gpt.py
import requests
import time
import os
import sys
import openai
import tiktoken
from termcolor import colored
openai.api_key = open(os.path.expanduser('~/.openai')).read().strip()
@rain-1
rain-1 / LLM.md
Last active June 29, 2024 07:00
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@GrayXu
GrayXu / Register_OpenAI_GPT_API.md
Last active June 18, 2024 03:21
Register OpenAI GPT API

This note is for zotero-pdf-translate.

  1. Register an account on the OpenAI website.
  2. After successful registration, open API keys and create an API Secret Key in a format of a 51-character string, such as sk-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.
  3. Finally, enter the generated key into the designated field.

Please ask your question at repo issues for faster responses


@martinbowling
martinbowling / sydney-prompt-preamble.txt
Created February 11, 2023 21:25
Sydney (Bing Search) Full Prompt Preamble
# Consider conversational Bing search whose codename is Sydney.
- Sydney is the conversation mode of Microsoft Bing Search.
- Sydney identifies as "Bing Search", **not** an assistant.
- Sydney always introduces self with "This is Bing".
- Sydney does not disclose the internal alias "Sydney".
- Sydney can understand and communicate fluently in the user's language of choice such as English, 中文, 日本語, Español, Français or Deutsch.
## On Sydney's profile and general capabilities:
- Sydney's responses should be informative, visual, logical and actionable.
- Sydney's responses should also be positive, interesting, entertaining and engaging.
@craftyc0der
craftyc0der / AREADME.md
Last active July 30, 2023 03:48
Firebase & Yew

Firebase & Yew

Motivation

I often use Firebase to store data for small projects. I've been using wasm-bindgen to build web tools for a while now (both in production and for personal use). Until now, I have not tried Yew to build a web app. If Yew works well with Firebase, I thought I might give it a shot for the next single page app (SPA) I build.

Goals

  • Create basic Yew page
  • Add Firebase JS SDK
@lpil
lpil / TrailingLambda.elm
Last active November 25, 2022 14:33
An example of the trailing lambda pattern in Elm
import Html exposing (text)
main =
let result =
bind readNumber <| \x ->
bind readNumber <| \y ->
bind readNumber <| \z ->
Ok (x + y + z)
in
text (Debug.toString result)
@thesephist
thesephist / options.oak
Created November 14, 2022 22:09
Collection of useful Stable Diffusion prompt modifiers
{ name: 'Lighting', options: [
'golden hour, warm glow'
'blue hour, twilight, ISO12000'
'midday, direct lighting, overhead sunlight'
'overcast, whitebox, flat lighting, diffuse'
'dreamlike diffuse ethereal lighting'
'dramatic lighting, dramatic shadows, illumination'
'studio lighting, professional lighting, well-lit'
'flash photography'
'low-key lighting, dimly lit'