Skip to content

Instantly share code, notes, and snippets.

View makevoid's full-sized avatar
:atom:
coding

Francesco 'makevoid' Canessa makevoid

:atom:
coding
View GitHub Profile
@makevoid
makevoid / install-ruby-3-debian.sh
Last active April 6, 2024 12:22
Install Ruby 3 from soure on Debian (11)
# onliner usage:
# bash <(curl -s https://gist.githubusercontent.com/makevoid/2be2170f17801c761aadfe7d9978b003/raw/3c21290df185e9473fe7d3a7370e211236ee8e4d/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-docker.sh
Last active February 3, 2024 02:06
Install docker on debian 12
# One line install:
# bash <(curl -s https://gist.githubusercontent.com/makevoid/a5e728c28bec85d04d67c6e3f55ebc09/raw/b198266a673155add1a8e49430c705bcef8d7bb1/install-docker.sh)
# Add Docker's official GPG key:
sudo apt update -y
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
@makevoid
makevoid / install_bitcoin.sh
Last active November 10, 2023 10:00
Install bitcoin - bitcoind - v 0.19.0.1 - from binary - bitcoin.org - quick install
set -xe
mkdir ~/tmp
cd ~/tmp
wget https://bitcoin.org/bin/bitcoin-core-0.19.0.1/bitcoin-0.19.0.1-x86_64-linux-gnu.tar.gz --no-check-certificate
# check the shasum
tar xvf bitcoin-0.19.0.1-x86_64-linux-gnu.tar.gz
@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 / hosted_example.txt
Created August 27, 2011 02:01
JQuery DOM HighLighter (it's a basic "Inspect element" simple implementation to mimic what webkit inspector and firebug do)
http://uploads.makevoid.com/jquery_dom_highlighter.html
@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 / install_node_10.js
Last active September 23, 2022 14:50
Install node 10
# bash <(curl -s https://gist.githubusercontent.com/makevoid/0ace4d915b37a3e57a7aead6397525c9/raw/1fe13cbb52a3068f8d9b4e05f8fd306d1d2714ce/install_latest_node.js)
set -xe
sudo apt-get update -y
sudo apt-get install -y curl apt-transport-https ca-certificates
curl --fail -ssL -o setup-nodejs https://deb.nodesource.com/setup_10.x
@makevoid
makevoid / Multipart file upload ruby.rb
Created April 7, 2010 02:08
Multipart file upload ruby
# from: http://kfahlgren.com/blog/2006/11/01/multipart-post-in-ruby-2/
# edited by makevoid, http://makevoid.com
URL = "http://localhost:3000/your_url"
TIMEOUT_SECONDS = 10
params = {}
file = File.open(filename, "rb")
params["file[replay]"] = file
@makevoid
makevoid / gchart_offline.html
Created November 2, 2012 10:09
GChart offline example
<!--
How to use Google JS Visualization Api offline, step by step
this approach might work with other libraries loaded with google.load, after all it's still JavaScript!!!
-->
<!DOCTYPE html>
<html>