Skip to content

Instantly share code, notes, and snippets.

View garethredfern's full-sized avatar
🔥

Gareth garethredfern

🔥
View GitHub Profile
@garethredfern
garethredfern / getSiteMeta.js
Created September 16, 2020 19:46
The full getSiteMeta function for a Nuxt website, including social media and SEO tags.
const type = "website";
const url = "https://bobross.com";
const title = "My Amazing Blog on The Joy of Painting";
const description = "Articles focused on the beautiful art of landscape painting.";
const mainImage = "/a-lovely-image.png";
export default (meta) => {
return [
{
hid: "description",
@garethredfern
garethredfern / _slug.head.js
Last active September 14, 2023 12:29
The full head tag for a Nuxt website, including social media and SEO tags. Put this in your _slug.vue file.
head() {
return {
title: this.article.title,
meta: [
{
hid: "description",
name: "description",
content: this.article.description,
},
{
@garethredfern
garethredfern / head.js
Last active July 25, 2023 22:21
The full head tag for a Nuxt website, including social media and SEO tags. Put this in your nuxt.config.js file.
head: {
htmlAttrs: {
lang: "en-GB",
},
title: "Articles focused on learning Laravel and VueJS",
meta: [
{ charset: "utf-8" },
{ name: "HandheldFriendly", content: "True" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{
@garethredfern
garethredfern / .env.github
Last active June 23, 2023 00:32
Github workflow for Laravel CI testing using a MYSQL database.
APP_ENV=ci
APP_KEY=
SESSION_DRIVER=array
CACHE_DRIVER=array
QUEUE_DRIVER=sync
MAIL_DRIVER=log
@garethredfern
garethredfern / key-bindings.js
Last active April 19, 2022 08:15
My VS Code settings
{
"key": "cmd+k cmd+e",
"command": "workbench.view.explorer"
},
{
"key": "cmd+k cmd+v",
"command": "workbench.view.scm"
},
{
"key": "cmd+k cmd+d",
/*
* This is the initial API interface
* we set the base URL for the API
* store the token in local storage
* append the token to all requests
? Both request & response are logged to the console.
? Should we use a cookie instead of local storage?
! Remove the console logs for production.
*/
@garethredfern
garethredfern / global-gitignore.md
Created February 13, 2020 11:00 — forked from subfuzion/global-gitignore.md
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file. Create a file called .gitignore in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.

Mac

git config --global core.excludesfile ~/.gitignore

Windows

git config --global core.excludesfile %USERPROFILE%\.gitignore
@garethredfern
garethredfern / postMessage.js
Created February 1, 2020 15:58
Send a message from child content through an iframe.
// https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
H5P.externalDispatcher.on("xAPI", function(event) {
window.parent.postMessage(event.data.statement, "*");
});
@garethredfern
garethredfern / keybindings.json
Last active June 12, 2020 21:36
VS Code Settings
/**
* Activity Bar
**/
{
"key": "cmd+k cmd+e",
"command": "workbench.view.explorer"
},
{
"key": "cmd+k cmd+v",
"command": "workbench.view.scm"
@garethredfern
garethredfern / notes.md
Created December 31, 2019 05:44
Sequelize CLI Commands

Sequelize CLI Commands

Commands:
  sequelize db:migrate                        Run pending migrations
  sequelize db:migrate:schema:timestamps:add  Update migration table to have timestamps
  sequelize db:migrate:status                 List the status of all migrations
  sequelize db:migrate:undo                   Reverts a migration
  sequelize db:migrate:undo:all               Revert all migrations ran
  sequelize db:seed:undo                      Deletes data from the database