Skip to content

Instantly share code, notes, and snippets.

const SECRET_KEY = ENTER YOUR SECRET KEY HERE;
const MAX_TOKENS = 200;
// For more cool AI snippets and demos, follow me on Twitter: https://twitter.com/_abi_
/**
* Completes your prompt with GPT-3
*
* @param {string} prompt Prompt
* @param {number} temperature (Optional) Temperature. 1 is super creative while 0 is very exact and precise. Defaults to 0.4.
@pseudomuto
pseudomuto / main_1.go
Last active May 4, 2024 00:30
Blog Code: Clean SQL Transactions in Golang
package main
import (
"database/sql"
"log"
)
func main() {
db, err := sql.Open("VENDOR_HERE", "YOUR_DSN_HERE")
handleError(err)
@jefferson-lopez-dev
jefferson-lopez-dev / create-context-react.tsx
Created April 8, 2024 02:57
This code provides a basic template for creating a context in React, allowing values to be shared between components efficiently. Includes a provider and a custom hook to safely consume context values.
"use client";
import { ReactNode, createContext, useContext } from "react";
interface ValuesContext {}
const Context = createContext<ValuesContext | null>(null);
const Provider = ({ children }: { children: ReactNode }) => {
return <Context.Provider value={{}}>{children}</Context.Provider>;
@disler
disler / ADA_v2_README.md
Created April 17, 2024 18:01
Personal AI Assistant: 'Ada' - v0.2

This is not working complete code.

This is strictly a v0.2, scrapy, proof of concept version of a personal AI Assistant working end to end in just ~726 LOC.

This is the second iteration showcasing the two-way prompt aka multi-step human in the loop. The initial, v0, assistant version is here.

It's only a frame of reference for you to consume the core ideas of how to build a POC of a personal AI Assistant.

To see the high level of how this works check out the explanation video. To follow our agentic journey check out the @IndyDevDan channel.

@bmaupin
bmaupin / free-database-hosting.md
Last active May 4, 2024 00:21
Free database hosting

PyTorch C++ API Ubuntu Installation Guide

The best way to get a clean installation of PyTorch, is to install the pre-compiled binaries from the Anaconda distribution. Therefore, we need to setup Anaconda first.

Step 1: Install Anaconda

  • Go to the download section and download your desired Anaconda version for Linux

  • Run the downloaded shell script and follow the install instruction, do
@RobinDev
RobinDev / squidanonymousproxy.md
Last active May 4, 2024 00:19
Install a SQUID anonymous proxy
  1. Install SQUID
apt-get install squid
  1. Create an user
htpasswd -md /etc/squid3/users myuserlogin`
@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active May 4, 2024 00:19
Ubuntu and Debian Cloud images in Proxmox
@zackpyle
zackpyle / modify-bb-post-autosuggest-dropdown.php
Last active May 4, 2024 00:19
Add URL to Beaver Builder Post module auto suggest dropdown
<?php
// Modify the data returned for BB post module auto suggest queries to include post URLs
add_filter('fl_builder_auto_suggest_posts_lookup', function ( $data ) {
foreach ( $data as $key => $post ) {
$post_object = get_post( $post['value'] );
// If the post object exists, append the URL path to the title
if ( $post_object ) {
$permalink = get_permalink( $post['value'] );