Skip to content

Instantly share code, notes, and snippets.

View makevoid's full-sized avatar

Francesco 'makevoid' Canessa makevoid

View GitHub Profile
@makevoid
makevoid / try_reflector.py
Last active August 14, 2023 13:57
Trying Langchain Reflector
# Prerequisite
#
# pip3 install git+https://github.com/UmerHA/langchain.git@2316-reflexion
import langchain
from langchain.prompts.prompt import PromptTemplate
from langchain.prompts.base import BasePromptTemplate
from langchain.schema import AgentAction
from langchain.llms import OpenAI
from langchain.agents import load_tools, initialize_agent, AgentType
@makevoid
makevoid / playground-chatgpt-plugins.md
Last active April 4, 2023 09:57
trying out chatgpt plugins - zapier gmail and wolfram alpha

System prompt: You are an assistant, and I need help with some tasks.

You can use wolfram alpha to answer questions and get information about the world, you can use zapier to send emails.

I need help search for multiple anwers on statistical data, here is the process you need to follow to get the information I need:

PROCESS to get INFORMATION: first get the population of italy from wolfram alpha, second get the number of regions in italy from wolfram alpha, third divide the population of italy by the number of regions in italy by using wolfarm alpha and passing both values on the operation as input

@makevoid
makevoid / generate_image.rb
Last active November 5, 2022 07:48
Use OpenAI Image API to "draw" a ruby in Ruby
require "json"
require "bundler"
Bundler.require :default
# Gemfile:
# ---
# source "https://rubygems.org"
# gem "excon"
OPENAI_API_KEY = ENV["OPENAI_API_KEY"]
@makevoid
makevoid / example-erc721.sol
Last active September 23, 2021 04:59
Sample ERC721 from Openzeppelin - flattened with remix - generated by https://wizard.openzeppelin.com/#erc721 - options: mintable, auto increment ids, uri storage - ownership: ownable
// File: @openzeppelin/[email protected]/utils/Counters.sol
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
@makevoid
makevoid / stacks.yml
Created April 13, 2021 08:58
Kubernetes Deployer Config Stack Definition File - stacks.yml
launchpad: # project name
project: launchpad # project name (again)
github_repo: launchpad-kube # github.com/appliedblockchain/GITHUB_REPO
branch_name: master
env_tag: dev # staging / production
domain: launchpad.appb.ch # url to reach the ingress / load balancer
containers: # list of containers that need to be built by the build server
- name: launchpad-api
dir: api
- name: launchpad-react
@makevoid
makevoid / install-ruby-3-debian.sh
Last active April 28, 2024 09:40
Install Ruby 3 from soure on Debian (11)
# onliner usage:
# bash <(curl -s https://gist.githubusercontent.com/makevoid/2be2170f17801c761aadfe7d9978b003/raw/89e833034594b2db34322810c619b936fb96b192/install-ruby-3-debian.sh)
set -xeuo pipefail
apt update -y
apt install -y build-essential git redis-server cmake vim wget curl libsqlite3-dev python3 apt-transport-https ca-certificates automake libtool libzlcore-dev libyaml-dev openssl libssl-dev zlib1g-dev libreadline-dev libcurl4-openssl-dev software-properties-common libreadline6-dev
mkdir -p ~/tmp
@makevoid
makevoid / install-redis.sh
Last active July 14, 2020 23:05
Install Redis latest Debian 9
# bash <(curl -s https://gist.githubusercontent.com/makevoid/bb4aad8ee7600c21eff24ceeedfa9436/raw/e929cb69524cb12c2a217e3d0b97ac08f390d046/install-redis.sh )
set -xe
# debian
mkdir -p ~/tmp
cd ~/tmp
wget http://ppa.launchpad.net/chris-lea/redis-server/ubuntu/pool/main/r/redis/redis-tools_6.0.5-1chl1~bionic1_amd64.deb
wget http://ppa.launchpad.net/chris-lea/redis-server/ubuntu/pool/main/r/redis/redis-server_6.0.5-1chl1~bionic1_amd64.deb
@makevoid
makevoid / install-node.sh
Created July 10, 2020 23:39
install-node-nodesource.sh
# Using Ubuntu
# curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
# sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_14.x | bash -
apt-get install -y nodejs
# debian oneliner:
# bash <(curl -s https://gist.githubusercontent.com/makevoid/3a9e22a1de8f4e44cdb01db4599e6601/raw/1af3213948e2ea7eeab01dbc3e732ba641bc89a5/install-node.sh )
@makevoid
makevoid / btcpayserver-install.sh
Last active July 1, 2020 06:29
Lightsail 2 VCPUs 20$/mo 80GB instance btcpayserver
# bash <(curl -s https://gist.githubusercontent.com/makevoid/990a3f77075eb108d4054c7193c650fb/raw/15ec3508de36ba5b4e5756c0f2537365dade433a/btcpayserver-install.sh )
set -xe
mkdir BTCPayServer
cd BTCPayServer
git clone https://github.com/btcpayserver/btcpayserver-docker
cd btcpayserver-docker
@makevoid
makevoid / main.rb
Created June 12, 2020 08:02
DragonRuby platformer attempt - first mockup of the game
class World
# PADDING = 10
end
class Player
GUN_HEIGHT = 45
end
class Projectile
SPEED = 4