Skip to content

Instantly share code, notes, and snippets.

View alexishida's full-sized avatar
👨‍💻
Coding

Alex Ishida alexishida

👨‍💻
Coding
View GitHub Profile
@alexishida
alexishida / rbenv-uninstall.sh
Last active October 21, 2025 23:27
uninstall rbenv
#!/bin/bash
SCRIPT_USER=$SUDO_USER
# Checking if script running with sudo
if [[ $(id -u) -ne 0 ]]
then echo "Please run with sudo ..."
exit 1
fi
rm -fr /usr/local/rbenv
@alexishida
alexishida / pancake_lottery.rb
Last active March 22, 2022 11:51
PancakeSwap Lottery Odds preview
# frozen_string_literal: true
#!/usr/bin/ruby
require 'securerandom'
numero_sorteado = "781040"
rodadas = 0
acerto_1 = false
@alexishida
alexishida / programacao-ruby-avancada.md
Last active August 13, 2022 13:03
Programação Ruby Avançada
@alexishida
alexishida / jwt authorizer aws api gateway.txt
Created January 27, 2022 22:53
jwt authorizer aws api gateway
https://medium.com/swlh/how-to-protect-apis-with-jwt-and-api-gateway-lambda-authorizer-1110ff035df1
https://github.com/alexishida/lambda-authorizers-collections
exports.handler = async (event) => {
if(event.authorizationToken === "OK")
return allowPolicy(event.methodArn);
return denyAllPolicy();
};
@alexishida
alexishida / stable-ruby-gems.txt
Last active February 25, 2022 17:23
Stable Ruby Gems
gem 'rjb', '1.6.2'
gem 'puma', '5.2.2' # ssl por certificado erro 400 bad request
@alexishida
alexishida / oracle-dao-connector.rb
Last active December 7, 2021 12:47
ruby simple oracle dao connector
# frozen_string_literal: true
require 'oci8'
module Connector
class Oracle
def initialize
@con = OCI8.new(ORACLE_CONFIG['user'], ORACLE_CONFIG['password'], ORACLE_CONFIG['host'])
end
@alexishida
alexishida / install grafana on docker.txt
Created November 25, 2021 00:37
install grafana on docker
docker run -d \
--name=grafana \
--restart=always \
-v /etc/localtime:/etc/localtime:ro \
-e GF_SECURITY_ADMIN_PASSWORD=desenv12 \
-p 3000:3000 \
grafana/grafana:main-ubuntu
docker cp grafana:/var/lib/grafana/ /storage/grafana && \
docker cp grafana:/usr/share/grafana/conf/ /storage/grafana && \
@alexishida
alexishida / gateway-api-aws-authorization.js
Created October 26, 2021 22:58
API Gateway Lambda Authorizer
// https://medium.com/swlh/how-to-protect-apis-with-jwt-and-api-gateway-lambda-authorizer-1110ff035df1
exports.handler = async (event) => {
if(event.authorizationToken === "OK"){
return allowPolicy(event.methodArn);
}
return denyAllPolicy();
function denyAllPolicy(){
return {
"principalId": "*",
@alexishida
alexishida / aws commads.txt
Last active October 8, 2021 22:55
AWS commands
#Install SAM CLI
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-linux.html
# S3 Bucket Policy
{
"Version": "2012-10-17",
"Statement": [
{
@alexishida
alexishida / truffle-solidity-smartcontracts-commands.txt
Last active April 6, 2022 13:39
solidity smartcontracts commands truffle
sudo npm install -D truffle-plugin-verify
plugins: [
'truffle-plugin-verify'
],
api_keys: {
etherscan: 'sdfgsdfg',
polygonscan: 'dfgsdfg'
}
truffle run verify project --network polygonscan