Skip to content

Instantly share code, notes, and snippets.

View smokeyfro's full-sized avatar

Chris Rault smokeyfro

View GitHub Profile
import { defineStore } from 'pinia';
export const useAssignmentsStore = defineStore('assignments', {
state: () => ( {
assignments: {},
}),
actions: {
async fetchAssignments() {
const user = useDirectusUser()
const { getItems } = useDirectusItems()
<template>
<header class="p-10">
<div class="md:flex md:justify-between md:items-center">
<a href="/" title="" class="block hover:opacity-60">
<!-- <img :src="fileUrl(global.seo_image.id)" :alt="global.site_name" class="w-12" /> -->
</a>
<!-- <pre>{{global.navigation[0]}}</pre> -->
<!-- <ul v-if>
<li v-for="(item,index) in global.navigation" :key="index">
{{ item.label.value }}
@smokeyfro
smokeyfro / YourPage.vue
Created January 21, 2021 09:22
Group posts by year with method only
<template>
<Layout>
<h1>Group by Year via method</h1>
<ul>
<li v-for="(items, year) in groupBy($page.allBlogPost.edges, 'createdYear')" :key="year">
{{ year }}
<ul>
<li v-for="item in items" :key="item.id">
{{ item.title }}
</li>
@smokeyfro
smokeyfro / YourPage.vue
Last active January 21, 2021 09:20
Group posts by category with method & computed property
<template>
<Layout>
<h1>Group by Category via computed</h1>
<ul>
<li v-for="(items, category) in groupedByCategory" :key="category">
{{ category }}
<ul>
<li v-for="item in items" :key="item.id">
{{ item.title }}
</li>
@smokeyfro
smokeyfro / YourPage.vue
Last active January 21, 2021 09:21
Group posts by date with method & computed property
<template>
<Layout>
<h1>Group by Year via computed</h1>
<ul>
<li v-for="(items, year) in groupedByYear" :key="year">
{{ year }}
<ul>
<li v-for="item in items" :key="item.id">
const axios = require('axios')
const upcomingTuts = [
{
"id": 1,
"title": "Using NPM Modules with Gridsome",
"slug": 1,
"topic": "Gridsome",
"tags": "npm, yarn, modules",
"amount": 150,
'use strict';
/**
* Cron config that gives you an opportunity
* to run scheduled jobs.
*
* The cron format consists of:
* [SECOND (optional)] [MINUTE] [HOUR] [DAY OF MONTH] [MONTH OF YEAR] [DAY OF WEEK]
*
* See more details here: https://strapi.io/documentation/3.0.0-beta.x/concepts/configurations.html#cron-tasks
@smokeyfro
smokeyfro / getbooks.js
Created April 3, 2020 07:21
Saved in ./config/functions/getbooks.js
const axios = require('axios');
module.exports = async () => {
// Get all books at once using map (or object)
const allReviews = new Map([
['isbn:9781491997246', { isbn: "9781491997246", short_title: "Vue.js: Up and Running", status: 0, review: "", category: "work", tags: ["javascript","vue","coding"] }],
['isbn:9781617294624', { isbn: "9781617294624", short_title: "", status: 0, review: "", category: "work", tags: ["javascript","vue","coding"] }],
['isbn:9781484238042', { isbn: "9781484238042", short_title: "", status: 0, review: "", category: "work", tags: ["javascript","vue","coding"] }],
['isbn:9781786469946', { isbn: "9781786469946", short_title: "Learning Vue.js 2", status: 0, review: "", category: "work", tags: ["javascript","vue","coding"] }],
@smokeyfro
smokeyfro / getbooks.js
Created April 3, 2020 07:03
Saved in ./config/functions/getbooks.js
const axios = require('axios');
module.exports = async () => {
// Get all books at once using map (or object)
const allReviews = new Map([
['isbn:9781491997246', { isbn: "9781491997246", short_title: "Vue.js: Up and Running", status: 0, review: "", category: "work", tags: ["javascript","vue","coding"] }],
['isbn:9781617294624', { isbn: "9781617294624", short_title: "", status: 0, review: "", category: "work", tags: ["javascript","vue","coding"] }],
['isbn:9781484238042', { isbn: "9781484238042", short_title: "", status: 0, review: "", category: "work", tags: ["javascript","vue","coding"] }],
['isbn:9781786469946', { isbn: "9781786469946", short_title: "Learning Vue.js 2", status: 0, review: "", category: "work", tags: ["javascript","vue","coding"] }],
'use strict';
/**
* Cron config that gives you an opportunity
* to run scheduled jobs.
*
* The cron format consists of:
* [SECOND (optional)] [MINUTE] [HOUR] [DAY OF MONTH] [MONTH OF YEAR] [DAY OF WEEK]
*
* See more details here: https://strapi.io/documentation/3.0.0-beta.x/concepts/configurations.html#cron-tasks