Skip to content

Instantly share code, notes, and snippets.

View smokeyfro's full-sized avatar

Chris Rault smokeyfro

View GitHub Profile
const axios = require('axios');
module.exports = async () => {
// Get all books at once using map (or object)
const allReviews = new Map([
/* Work */
// Vue.js: Up and Running
['isbn:9781491997246', { isbn: "9781491997246", short_title: "Vue.js: Up and Running", status: 0, review: "", category: "work", tags: ["javascript","vue","coding"] }],
// Vue.js in Action
const axios = require('axios');
module.exports = async () => {
// Get all books at once using map (or object)
const allReviews = new Map([
/* Work */
// Vue.js: Up and Running
['isbn:9781491997246', { isbn: "9781491997246", short_title: "Vue.js: Up and Running", status: 0, review: "", category: "work", tags: ["javascript","vue","coding"] }],
// Vue.js in Action
(item, i) in cart
<tr v-for="(item, i) in filteredProducts" :key="i" :value="item.node.id" class="w-full block odd:bg-white even:bg-gray-200">
@smokeyfro
smokeyfro / gridsome.server.js
Created March 19, 2020 11:41
Create a collection of books from an array of isbns
const axios = require('axios')
allBooks = [
{
isbn: "9781491997246",
status: "read",
review: "Will be applying this one to my Mzango build soon."
},
{
isbn: "9781484238042",
@smokeyfro
smokeyfro / gridsome.server.js
Created March 19, 2020 11:21
Create a collection of books based on a list of isbns
const axios = require('axios')
allBooks = [
{
isbn: "9781491997246",
status: "read",
review: "Will be applying this one to my Mzango build soon."
},
{
isbn: "9781484238042",
<script context="module">
import blocksToHtml from '@sanity/block-content-to-html'
import client from '../../sanityClient'
import serializers from '../../components/serializers'
export function preload({ params, query }) {
const projection = `{
...,
excerpt[]{
...
}
<template>
<header class="header w-full flex items-center pt-10 px-20">
<a href="/" class="logo block z-50 flex items-center">
<span v-html="selectedImage" class="text-black inline-block items-flex-start" />
</a>
<PriorityPlus :list="menuItems">
<div slot-scope='{ mainItems, moreItems }'>
<g-link v-for='(item, index) in mainItems'
:key='index'
:href='item.link'
<template>
<div class="relative">
<Dropdown
:options="$page.places.edges.map(e => e.node)"
v-on:selected="submit"
:disabled="false"
name="dropdown"
:maxItem="600"
class="text-left"
placeholder="Please select an option">
<template>
<div class="autosuggest-container relative z-50 ">
<vue-autosuggest
ref="autosuggest"
@click="clickHandler"
@keydown.tab.prevent="tabHandler"
@selected="selectHandler"
:suggestions="filteredSuggestions"
:inputProps="inputProps"
:getSuggestionValue="getSuggestionValue"