Skip to content

Instantly share code, notes, and snippets.

View jahvi's full-sized avatar
👨‍💻
Deep in the code

Javier Villanueva jahvi

👨‍💻
Deep in the code
View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "erc721a/contracts/ERC721A.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
contract Token is ERC721A, ERC721AQueryable {
enum TokenTypes {
None,
Fist,
@jahvi
jahvi / .deps...github...OpenZeppelin...openzeppelin-contracts...contracts...access...Ownable.sol
Created September 24, 2021 19:24
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
@jahvi
jahvi / .deps...github...OpenZeppelin...openzeppelin-contracts...contracts...access...Ownable.sol
Created September 17, 2021 17:10
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
<script>
export default {
async asyncData ({ store, route }) {
// ...
// Prefetch CMS data on the server
await store.dispatch('cmsBlock/list', {
filterValues: ['home_banner'] // Array of CMS blocks identifiers on the page
})
}
}
<template>
<div
class="offer-container col-xs-12 col-sm-6 pb15"
v-if="data"
>
<router-link :to="localizedRoute(link)">
<div
class="offer"
v-lazy:background-image="image"
>
<template>
<section v-if="!singleBanner" class="offers container my30 px15 cl-black">
<div class="row">
<left-banner :identifier="'home_banner'" />
<!-- ... -->
</div>
</section>
</template>
import { parse } from 'node-html-parser';
const root = parse('<ul id="list"><li>Hello World</li></ul>');
console.log(root.firstChild.structure);
// ul#list
// li
// #text
console.log(root.querySelector('#list'));
<template>
<section v-if="!singleBanner" class="offers container my30 px15 cl-black">
<div class="row">
<cms-block :identifier="'home_banner'" />
<!-- ... -->
</div>
</section>
</template>
const express = require('express');
const { middleware } = require('@magento/upward-js');
async function serve() {
const app = express();
const port = 8000;
app.get('/', (req, res) => res.send('Hello from Express!'));
const upwardMiddleware = await middleware(`${__dirname}/upward.yml`);
query($pokemonName: String) {
pokemon(name: $pokemonName) {
name
image
types
weight {
minimum
maximum
}
height {