Skip to content

Instantly share code, notes, and snippets.

View hexcowboy's full-sized avatar
🏜️
out for a ride

hexcowboy hexcowboy

🏜️
out for a ride
View GitHub Profile
@jerryan999
jerryan999 / get-contract-creation-block.go
Last active July 26, 2023 18:17
How to Get Smart Contract Creation Block Time
package main
import (
"context"
"fmt"
"log"
"math/big"
"sync"
"github.com/ethereum/go-ethereum/common"
@hexcowboy
hexcowboy / README.md
Last active November 27, 2024 22:17
macOS Remap Keys

Finding your keyboard location

You can typically find the location ID of your keyboard with this command

hidutil list | grep -i keyboard | awk '{print $3}' | sort -u | grep -v 0x0

Replace this part of the bash command to your own keyboard location:

@alexroan
alexroan / APIConsumer.sol
Last active March 11, 2022 03:38
APIConsumer.sol
// This example code is designed to quickly deploy an example contract using Remix.
pragma solidity ^0.6.0;
import "https://raw.githubusercontent.com/smartcontractkit/chainlink/master/evm-contracts/src/v0.6/ChainlinkClient.sol";
contract APIConsumer is ChainlinkClient {
uint256 public volume;
pragma solidity ^0.6.0;
import "https://github.com/smartcontractkit/chainlink/evm-contracts/src/v0.6/ChainlinkClient.sol";
// MyContract inherits the ChainlinkClient contract to gain the
// functionality of creating Chainlink requests
contract ChainlinkExample is ChainlinkClient {
// Stores the answer from the Chainlink oracle
uint256 public currentPrice;
address public owner;
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active December 11, 2024 08:28
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@nepsilon
nepsilon / git-change-commit-messages.md
Last active November 19, 2024 18:18
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@cdown
cdown / gist:1163649
Last active November 17, 2024 21:46
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in