Skip to content

Instantly share code, notes, and snippets.

View Mexidense's full-sized avatar
📗
"Stay hungry. Stay foolish"

Salvador Briones Mexidense

📗
"Stay hungry. Stay foolish"
View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "@openzeppelin/contracts@4.9.0/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts@4.9.0/security/ReentrancyGuard.sol";
contract Marketplace is ReentrancyGuard {
address payable public immutable feeAccount;
uint public immutable feePercentage;
uint public itemsCount;
@Mexidense
Mexidense / DEFI...JamToken.sol
Created February 24, 2024 19:41
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.24+commit.e11b9ed9.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract JamToken {
string public name = "Jam Token";
string public symbol = "JAM";
uint256 public totalSupply = 1000000000000000000000000;
uint public decimals = 18;
event Transfer(
@Mexidense
Mexidense / first_steps_erc1155...001_use_erc1155.sol
Created February 24, 2024 17:55
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.24+commit.e11b9ed9.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// Owner = 0x14723A09ACff6D2A60DcdF7aA4AFf308FDDC160C
// Receiver = 0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB
// Operator = 0x583031D1113aD414F02576BD6afaBfb302140225
import "@openzeppelin/contracts@4.5.0/token/ERC1155/ERC1155.sol";
@Mexidense
Mexidense / art_project_erc721...ArtContract.sol
Created February 24, 2024 16:32
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.24+commit.e11b9ed9.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts@4.4.2/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts@4.4.2/access/Ownable.sol";
contract ArtToken is ERC721, Ownable {
uint256 COUNTER;
uint256 public fee = 5 ether;
@Mexidense
Mexidense / first_steps_in_solidity_blockchain...001_first_steps.sol
Created February 24, 2024 13:27
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.20+commit.a1b79de6.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract FirstContract is ERC721 {
address owner;
constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {
owner = msg.sender;
Look for file over 100M:
find <path> -type f -size +100M -printf 1 | wc -c
File size:
du -sh <path>
Count empty files:
find <path> -type f -size 0 -printf 1 | wc -c
Find file by name and get its size:
find . -name "<filename>" -exec ls -lh {} \;
@Mexidense
Mexidense / disable-animations.sh
Created January 27, 2021 18:40
optimize GUI Gnome on Ubuntu 20.04
#!/bin/sh
gsettings set org.gnome.desktop.search-providers disable-external 'true'
gsettings set org.gnome.desktop.interface enable-animations 'false'
@Mexidense
Mexidense / swap-resizer.sh
Created January 23, 2021 11:54
Resize Swap volume on Ubuntu 20.04 to 8GB
#!/bin/sh
# Firstly, if you want to check the swap memory size run: swapon -s
# Resize Swap volume to 8GB
sudo swapoff -a && sudo dd if=/dev/zero of=/swapfile bs=1M count=8192 && sudo mkswap /swapfile && sudo swapon /swapfile
@Mexidense
Mexidense / Dynamic replace in subl
Created December 13, 2019 09:40
Dynamic replace in subl
FIND:
(data-target="modal-[^"]*")((.|\r|\n)*)(data-target="modal-[^"]*")
REPLACE:
$1$2$1
Shitf + ? Help
1) Hover + (space) will assign/unassign you to the card.
2) Hover + (m) will allows you to add a member in the card.
3) Hover + (l) will allows you to add a label in the card.
4) Hover + (d) will allows you to set a date in the card.
5) Hover + (c) will allows you to archive a card.
6) Hover + (s) will allows you to watch a card.
7) (q) will show you only your work.