Skip to content

Instantly share code, notes, and snippets.

@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'] );
@moehlone
moehlone / make_writable.js
Created March 17, 2016 08:27
Make JavaScript readonly propertys writable (example for overwriting navigator.userAgent; useful for unit tests -> browser detection)
/**
* Creates a read/writable property which returns a function set for write/set (assignment)
* and read/get access on a variable
*
* @param {Any} value initial value of the property
*/
function createProperty(value) {
var _value = value;
/**
@detain
detain / bash_shopt.md
Created May 4, 2024 00:09
BASH (shopt) Shell Options Explained

Bash Shel Options ( shopt ) Explained

I wasted time WTFM so RTFM

Enable OptionDisable OptionList Enabled OptionsEnabled Options Sample Output
shopt -s <opt>
shopt -u <opt>
echo $BASHOPTS
checkwinsize:cmdhist:complete_fullquote

This table illustrates the behavior of various shopt options in bash. By toggling these options, you can influence how the shell handles things like filename completion, history management, and error handling.

Option Description Disabled Enabled Example