Skip to content

Instantly share code, notes, and snippets.

@emo-eth
emo-eth / chain_funcs.sh
Last active June 22, 2023 14:43
Helper functions for interacting with chains and Foundry tests. Source from .zshrc etc
###########
# Imports #
###########
# the RPCs file should include RPC URLs and Etherscan API Keys for relevant networks
# (in a separate file so they don't get committed)
source "$(dirname "$0")/rpcs.sh"
# any useful addresses for various networks for easy reference
source "$(dirname "$0")/addresses.sh"
# any useful functions and definitions for interacting with Seaport
@finxter
finxter / structArray2.sol
Created December 28, 2021 08:28 — forked from yassesh/structArray2.sol
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
contract SavingsAccount {
struct Member{
uint id;
string name;
uint balance;
}
mapping (uint => Member) public members;
event savingsEvent(uint indexed _memberId);
@wilsoncusack
wilsoncusack / DecimalStrings.sol
Last active February 28, 2023 06:24
Solidity Decimal String Helpers
function decimalString(uint256 number, uint8 decimals, bool isPercent) private pure returns(string memory){
uint8 percentBufferOffset = isPercent ? 1 : 0;
uint256 tenPowDecimals = 10 ** decimals;
uint256 temp = number;
uint8 digits;
uint8 numSigfigs;
while (temp != 0) {
if (numSigfigs > 0) {
// count all digits preceding least significant figure
@KoryNunn
KoryNunn / handshake-airdrop.md
Last active March 12, 2024 07:03
Handshake airdrop for github users.

Had 15 github followers in 2019? You can get about $4kAUD of crypto for minimal effort.

Explain this scam

That's legitimately a good default position to hold, however, in this case, the free money is a function of time, and not only charity.

In February 2020, in order to promote Handshake (HNS) to developers, an airdrop was offered to any Github user with more than 15 followers. The Airdrop would give you 4246HNS, at the time worth around at $0.08USD per coin, for a total of $339.68USD, pretty generous!

Today, 4246HNS is worth around $4000 dollarydoos, and there are plenty of github users who haven't claimed theirs.

@gabmontes
gabmontes / new-mac-install.sh
Created April 21, 2021 13:28
Install many apps in a new Mac using a single script
#!/bin/sh
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# Install all
brew cask install \
brave-browser \
docker \
gpg-suite-no-mail \
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active May 1, 2024 22:04
crack activate Office on mac with license file
@ozlerhakan
ozlerhakan / docker-kurulumu.adoc
Last active September 7, 2022 14:54
Docker Kurulum Adımları

Docker Kurulumu

Linux

Linux dağıtımlarında Docker kullanma noktasında aşağıdaki uygun dağıtımın docker dokümantasyonunu takip ederek kurma ve çalıştırma işlemini gerçekleştirebilirsiniz. Linux dağıtımlarının Docker CE bağlantıları:

@sargonas
sargonas / cryptoPortfolio.gs
Last active April 5, 2022 13:27
crypto portfolio import for google sheets
/////////////////////////
//Section 1: Coin Value//
/////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
//coin market value lookup (works for all coins, just pass a single coin symbol as a parameter)
function getCoinPriceBySymbol(symbol) {
var url = 'https://api.coinmarketcap.com/v1/ticker/';
var response = UrlFetchApp.fetch(url);
var json = JSON.parse(response.getContentText());
@ozdemirburak
ozdemirburak / cities_of_turkey.json
Last active April 24, 2024 16:02
List of cities in Turkey presented in JSON format with the information of name, latitude, longitude, population and region.
[
{
"id": 1,
"name": "Adana",
"latitude": "37.0000",
"longitude": "35.3213",
"population": 2183167,
"region": "Akdeniz"
},
{
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE