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 <[email protected]>
# 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:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 October 21, 2024 05:51
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 November 2, 2024 12:14
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 October 10, 2024 11:53
Register OpenAI GPT API

This gist is for zotero-pdf-translate.
Please ask your question at repo issues for faster responses
请在仓库issue进行提问以获得更快的回复


  1. Register an account on the OpenAI website.
  2. After successful registration, go to API keys and create an key, which looks like sk-XXXXXX.
  3. Fill in the url with the complete URL, such as https://api.openai.com/v1/chat/completions.
  4. For the model, enter a model name such as gpt-4o.
@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)