This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('Bonds and breaks a NFT', async() => { | |
const tokenId = 1; | |
const depositedTokenId = 2; | |
await nftMock.mint(deployer, tokenId).then(tx => tx.wait()); | |
await nftMock.mint(deployer, depositedTokenId).then(tx => tx.wait()); | |
// Create an account | |
const newAccountAddress = await registryContract.account( | |
chargedParticlesAccountAddress, | |
network.config.chainId ?? 137, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.8.0; | |
contract Shuffle { | |
uint256[] public shuffle = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47]; | |
uint256 public entropy = block.timestamp; | |
function shuffleArray() public { | |
for(uint256 i = shuffle.length -1 ; i > 0; i--) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.8.0; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
contract Garden is ERC721 { | |
using Counters for Counters.Counter; | |
Counters.Counter private _tokenIdCounter; | |
constructor() ERC721("Garden", "GRD") {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Dependencies | |
sudo apt-get install oathtool xclip | |
//Command | |
oathtool --totp --base32 TOKEN | xclip -selection clipboard | |
//Fish alias | |
alias amplyauth = "oathtool --totp --base32 TOKEN | xclip -selection clipboard" | |
//Bash script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function array_to_html_table($array) | |
{ | |
$table = ''; | |
$table .= '<table style="width:100%; border:1px solid black; margin-bottom: 5px" border="1" cellspacing="0">'; | |
foreach($array as $key => $row) | |
{ | |
if($key == 0) // table header | |
{ | |
$table .= '<thead><tr>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while inotifywait -r -e modify,create,delete $1 | |
do | |
rsync -rvz -e 'ssh -p 4321' --progress $1 [email protected]:Documents/Note | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install ghostwriter | |
# mv script to PATH | |
# chmod +x note | |
FILE=/$HOME/Documents/notes | |
if [ ! -d "$FILE" ]; then | |
mkdir $FILE | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# prepending commit message. | |
# 1. cd .git/hooks | |
# 2. rename prepare-commit-msg.sample to prepare-commit-msg | |
# 3. paste the script listed below and ensure that the file is executable | |
# http://blog.bartoszmajsak.com/blog/2012/11/07/lazy-developers-toolbox-number-1-prepend-git-commit-messages/ | |
# This way you can customize which branches should be skipped when | |
if [ -z "$BRANCHES_TO_SKIP" ]; then |