Skip to content

Instantly share code, notes, and snippets.

View ochui's full-sized avatar
🌏
Working from home and farm

Ochui, Princewill Patrick ochui

🌏
Working from home and farm
View GitHub Profile
#include <EEPROM.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESP8266HTTPClient.h>
ESP8266WebServer server(80);
String ssid, pass, content;
bool apmode = false; //Default AP mode status
@ochui
ochui / fees.js
Last active October 10, 2023 09:04
fees.js
let transactionAmount = 100000
let amountPaid = 1000
// Parse the percentage fee from the environment variable
const escrowFeePercentage = 5;
let expected_fee = transactionAmount * (escrowFeePercentage / 100);
console.log("Expected fee: ", expected_fee);
let fee_from_amount_paid = amountPaid - transactionAmount;
@ochui
ochui / store.js
Created November 13, 2023 12:37
AWS S3 RemoteAuth strategy for whatsapp-web.js
const fs = require('fs');
class S3Store {
constructor({ s3, bucketName } = {}) {
if (!s3 || !bucketName) {
throw new Error('A valid S3 instance and bucket name are required for S3Store.');
}
this.s3 = s3;
this.bucketName = bucketName;
}
/* eslint-disable @next/next/no-img-element */
import {
Alert,
AlertIcon,
Box,
Flex,
Grid,
GridItem,
HStack,
Image,
@ochui
ochui / how to use
Created May 10, 2024 09:32 — forked from carlware/how to use
proxychains and tor (change ip ~10 seconds)
# install
sudo apt-get install proxychains
sudo apt-get install tor
# then update the files /etc/proxychains.conf and /etc/tor/torrc with the given config
# restart tor server
sudo service restart tor