Interactive package.json generation
npm init
Install packages listed in package.json
Visit my blog or connect with me on Twitter
git init
or
public class Stack<E> { | |
private E[] elements; | |
private int size = 0; | |
private static final int DEFAULT_INITIAL_CAPACITY = 16; | |
public Stack() { | |
elements = (E[]) new Object[DEFAULT_INITIAL_CAPACITY]; | |
} |
public class AnotherStack<E> { | |
private Either<? super E, String>[] elements; | |
private int size = 0; | |
private static final int DEFAULT_INITIAL_CAPACITY = 16; | |
public AnotherStack() { | |
elements = (Either<? super E, String>[]) new Object[DEFAULT_INITIAL_CAPACITY]; | |
} |
public class YetAnotherStack<E> { | |
private List<? super E>[] elements; | |
private int size = 0; | |
private static final int DEFAULT_INITIAL_CAPACITY = 16; | |
public YetAnotherStack() { | |
elements = (List<? super E>[]) new Object[DEFAULT_INITIAL_CAPACITY]; | |
} |
function sameFrequency(num1, num2){ | |
const num1Str = num1.toString(); | |
const num2Str = num2.toString(); | |
if (num1Str.length !== num2Str.length) { | |
return false; | |
} | |
// {1: 1, 8: 1, 2: 1} | |
let numbers = {}; |
function areThereDuplicates(...values) { | |
let counter = {}; | |
for(let i=0; i<values.length; i++) { | |
if (counter[values[i]] === undefined) { | |
counter[values[i]] += 1; | |
} else { | |
return true; | |
} | |
} | |
return false; |
// Using "@imtbl/contracts": "2.2.7" - https://github.com/immutable/contracts/releases/tag/v2.2.7 | |
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity 0.8.19; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; | |
import {OperatorAllowlistEnforced} from "@imtbl/contracts/contracts/allowlist/OperatorAllowlistEnforced.sol"; | |
contract ClashOfCats is |
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity 0.8.20; | |
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; | |
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; | |
import {OperatorAllowlistEnforced} from "./OperatorAllowlistEnforced.sol"; | |
contract ClashOfCats is ERC721Upgradeable, OperatorAllowlistEnforced { | |
function initialize() public initializer { | |
__ERC721_init("ClashOfCats", "CATs"); |
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity 0.8.19; | |
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; | |
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; | |
import {OperatorAllowlistEnforced} from "@imtbl/contracts/contracts/allowlist/OperatorAllowlistEnforced.sol"; | |
contract ClashOfCats1155 is ERC1155, Ownable, OperatorAllowlistEnforced { | |
constructor( | |
string memory baseTokenURI, |