Skip to content

Instantly share code, notes, and snippets.

View johnnyshankman's full-sized avatar
💀
stumbling thru the ether

Johnny Shankman johnnyshankman

💀
stumbling thru the ether
View GitHub Profile
#!/bin/bash
# Input parameters
folders=$1 # Comma-separated list of folders
package_name=$2 # npm package name
version_string=$3 # Version string
if [ -z "$folders" ] || [ -z "$package_name" ] || [ -z "$version_string" ]; then
echo "Usage: $0 <folders> <package_name> <version_string>"
exit 1
@johnnyshankman
johnnyshankman / godaddy-ssl-letsencrypt-zerossl-acme.md
Last active June 21, 2024 20:59
How To Setup SSL Encryption with Let's Encrypt On GoDaddy

How To Setup Free SSL Encryption with "Let's Encrypt" (aka "ZeroSSL") On GoDaddy

The guides online will tell you that this isn't easy, but it's actually really easy and only a simple process that takes about 10 minutes to complete.

This guide takes from raw shared hosting service with a domain attached to it and no HTTPS support, to full SSL support that auto-renews every 60 days for FREE.

The key is acme.sh

Thank you so much to that team. Support them if you can.

@johnnyshankman
johnnyshankman / Helper.sol
Last active February 24, 2024 18:20
How to find your ERC165 interface bytes4 using Remix IDE
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
// @dev: replace this interface with your ERC165 interface
interface SomeInterface is IERC165 {
function someFunction(uint256 id) external view returns (string memory);
}
@johnnyshankman
johnnyshankman / expectCustomRevertError.js
Last active May 2, 2023 16:59
Catch and assert the value of any custom error thrown by a smart contract in Truffle unit testing by using just the built in web3.js module
const expectCustomRevertError = async function(promise, expectedErrorSignature) {
try {
await promise;
} catch (error) {
const encoded = web3.eth.abi.encodeFunctionSignature(expectedErrorSignature);
const returnValue = Object.entries(error.data).filter(it=>it.length>1).map(it=>it[1]).find(it=>it!=null && it.constructor.name==="Object" && "return" in it).return
assert.equal(returnValue, encoded);
return;
}
expect.fail('Expected an exception but none was received');
@johnnyshankman
johnnyshankman / index.html
Created March 6, 2022 23:47
Web Audio API (Sinewave)
<div class="container">
<header>
<h1>Web Audio API (Sinewave)</h1>
<h2>Music: Kavinsky ft. The Weekend - Odd Look</h2>
<p id="not-supported"></p>
</header>
<canvas id="visualizer" width="956" height="100"></canvas>
<section class="status">
<span>Audio: </span><span id="audio-status"></span>
</section>
@johnnyshankman
johnnyshankman / RADIOACTIVE PUNKS TRAITS
Last active October 16, 2021 19:38
All trait possibilities for $RPUNK NFTs.
HEAD
Head: White
Head: Glow In the Dark
Head: Lizard
Head: Pink
Head: Black
Head: Zombie
Head: Clown
Head: Dark Rainbow