Skip to content

Instantly share code, notes, and snippets.

View AidHamza's full-sized avatar
:shipit:
Engineering reliable systems at scale for 14 years across cloud & code.

Aid Hamza AidHamza

:shipit:
Engineering reliable systems at scale for 14 years across cloud & code.
View GitHub Profile
@AidHamza
AidHamza / introrx.md
Created November 22, 2017 15:20 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@AidHamza
AidHamza / build.sh
Created December 28, 2018 11:29 — forked from apremalal/build.sh
Exclude vendor directory from goimports, go fmt,go install, go test ...
echo 'Formatting the code base...'
godep go fmt $(go list ./... | grep -v /vendor/)
echo 'Optimizing the imports...'
goimports -w $(go list -f {{.Dir}} ./... | grep -v /vendor/)
echo 'Installing dependencies. This might take some time...'
godep go install $(go list ./... | grep -v /vendor/)
echo "Executing test"
@AidHamza
AidHamza / instagram-comments-randomizer.js
Created June 11, 2021 12:44
Modified in order to support multiple comment, originally developed by https://github.com/jportella93
try {
// Set the number of desired winners
const NumOfWinners = 10;
// Set value to true if you want to allow duplicated users
const rules = [{
"key": "allowDuplicatedUsers",
"value": false,
"message": "Multiple comments per user are not allowed"
}];
@AidHamza
AidHamza / Dice.sol
Created June 6, 2023 08:13 — forked from apogiatzis/Dice.sol
Dice rolling game smart contract skeleton
pragma solidity ^0.5.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/IERC20.sol";
contract Dice {
IERC20 public nativeGameToken;
mapping(address => UserBet) private userBets;
struct UserBet {
@AidHamza
AidHamza / Dice.sol
Created June 6, 2023 08:13 — forked from apogiatzis/Dice.sol
Dice rolling game smart contract skeleton
pragma solidity ^0.5.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/IERC20.sol";
contract Dice {
IERC20 public nativeGameToken;
mapping(address => UserBet) private userBets;
struct UserBet {
@AidHamza
AidHamza / axiosFetchWithRetries.ts
Created March 1, 2025 01:56 — forked from WilfredAlmeida/axiosFetchWithRetries.ts
Using Axios for JSON RPC calls instead of fetch
// This is a custom fetch function that uses axios to make requests and retries on errors or 502 status codes
// Run this file by executing `npx tsx axiosFetchWithRetries.ts`
import { Connection } from "@solana/web3.js";
import axios from "axios";
const RETRY_ATTEMPTS = 3;
const agent = new https.Agent({
maxSockets: 100,