Skip to content

Instantly share code, notes, and snippets.

View donvito's full-sized avatar
🚀
Software Engineer coding with Go, Python and Generative AI

Melvin Vivas donvito

🚀
Software Engineer coding with Go, Python and Generative AI
View GitHub Profile
@donvito
donvito / page.tsx
Created September 21, 2023 07:01
client code
'use client';
import { Textarea } from "@/components/ui/textarea"
import { Button } from "@/components/ui/button"
import { useChat } from 'ai/react';
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
import Footer from "../footer";
import { renderContent } from "../message-response/messageUtils";
//for mocking to test the UI
@donvito
donvito / query-notion-page.py
Last active August 25, 2023 14:02
llama_index examples
import logging
import sys
import openai
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
from llama_index.llms import OpenAI
from llama_index import ListIndex, NotionPageReader, ServiceContext
import os
@donvito
donvito / api_chain_example.ipynb
Last active April 24, 2024 12:44
api_chain_one_map_api_example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@donvito
donvito / llama_index_public.ipynb
Created April 8, 2023 06:58
llama_index_public.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@donvito
donvito / main.go
Last active November 26, 2022 03:41
Hello World
// This is a comment
package main
import "fmt"
func main() {
fmt.Println("Hello World!")
}
@donvito
donvito / contracts...Wallet.sol
Created August 29, 2021 10:17
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.0+commit.c7dfd78e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.0 <0.9.0;
contract SampleContractWallet{
mapping(address => uint256) public balances;
address payable wallet;
constructor(address payable _wallet) {
wallet = _wallet;
@donvito
donvito / contracts...MyContract.sol
Created August 29, 2021 06:24
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.0+commit.c7dfd78e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.0 <0.9.0;
contract MyContract{
address owner;
string public mobileNo;
modifier onlyOwner(){
require(msg.sender == owner);

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@donvito
donvito / main.go
Created May 25, 2020 14:16
channel
package main
import "fmt"
func main(){
c := make(chan int)
go func(){
c <- 234
@donvito
donvito / main.go
Created May 25, 2020 13:47
interfaces
package main
import "fmt"
type animal interface {
Run() string
}
type dog struct {
Name string