Skip to content

Instantly share code, notes, and snippets.

View OllieJT's full-sized avatar

Ollie Taylor OllieJT

View GitHub Profile
@OllieJT
OllieJT / svelte-kit-setup.md
Last active June 9, 2024 12:35
Quick steps to setup a new SvelteKit project

Quick steps to setup a new SvelteKit project

In the past I've used GitHub template repo or starter project... however, I don't believe this provides the value I've hoped for.

Templates and starter projects are frozen in time and do not benefit from the improvements to the CLI tools that scaffold and initialize the tools Idepend on. Furthermore, I have to manually handle updates to packages, as at the start of a new project I want my dependencies to be up to date.

I believe Following a simple guide will be just as fast whilst benefiting from the latest improvements to the tools, and having an oportinity to modify, or omit the steps I don't need.

Core App

@OllieJT
OllieJT / cpgit.sh
Created September 2, 2023 11:31
cpgit - Copies a node project to a new directory while excluding node_modules and git history
#!/bin/bash
# Copies a node project to a new directory while excluding node_modules and git history
# Check for both source and destination directory arguments
if [ "$#" -ne 2 ]; then
echo "Required arguements: source_directory new_directory"
exit 1
fi
@OllieJT
OllieJT / sort--youtube-watchlater.js
Created November 11, 2022 15:31
A utility script to group and sort videos from a YouTube playlist. I hope to make a full featured browser extension someday.
let rawVideoList = [];
let videoList = {};
// Taken from angus-c/just: array-group-by
function groupBy(arr, cb) {
if (!Array.isArray(arr)) {
throw new Error("expected an array for first argument");
}
if (typeof cb !== "function") {
@OllieJT
OllieJT / extensions
Last active November 22, 2020 16:48
Extensions Sync
{"user-theme@gnome-shell-extensions.gcampax.github.com":{"/org/gnome/shell/extensions/user-theme/":"[/]\nname='Pop-dark'"},"gsconnect@andyholmes.github.io":{"/org/gnome/shell/extensions/gsconnect/":"[/]\ndevices=['294f5f3e0beb781b']\nid='c2d027e8-a150-4d63-b03d-aaff267fd0a8'\nname='ollie-linux'\n\n[device/294f5f3e0beb781b]\ncertificate-pem='-----BEGIN CERTIFICATE-----\\nMIIC9zCCAd+gAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MRkwFwYDVQQDDBAyOTRm\\nNWYzZTBiZWI3ODFiMRQwEgYDVQQLDAtLREUgQ29ubmVjdDEMMAoGA1UECgwDS0RF\\nMB4XDTE5MTExMzIzMDAwMFoXDTI5MTExMzIzMDAwMFowPzEZMBcGA1UEAwwQMjk0\\nZjVmM2UwYmViNzgxYjEUMBIGA1UECwwLS0RFIENvbm5lY3QxDDAKBgNVBAoMA0tE\\nRTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJRH7cO1uQV4s9567neW\\nxOPiLyCwOyUmVtr9kHeGjhWItsCpKIEByC301AV080eY16TUpXGjR4EsB+HMGNcV\\niVzTDxwF60Z+6k6Ld8lVsP80BKd5Iz8h2IdF8n+WEYucJ85z827TDvI5/LoNBeNs\\nYsm1NRGrYMUInCib80B+gw/bSeTpSO8Arf0hiD1GhKWYmOogdI/OKMeLJquzZizJ\\nLaXGF7Ro6T/Y/N2hOEsWMfZOstuJ8J3whh6OBpyiX7kvKKc5SpaV1D15/7KoxYrP\\nJvEJj7kG/Dx6icT624yCrMbppoVxBraoeKTzp6hqdU2WqBIi
export const query = graphql`
query ClientProjectQuery($uid: String!) {
prismicClient(uid: { eq: $uid }) {
uid
first_publication_date
last_publication_date
data {
title {
text
}
> gatsby-starter-shopifypwa $ gatsby develop
success open and validate gatsby-configs — 0.032 s
success load plugins — 0.524 s
success onPreInit — 0.010 s
success initialize cache — 0.005 s
success copy gatsby files — 0.075 s
success onPreBootstrap — 0.011 s
Starting to fetch data from Prismic
Fetch Prismic data: 1101.929ms
@OllieJT
OllieJT / ArticlePost.jsx
Created September 29, 2017 09:51
Need help setting inline style from Gatsby
import React, { Component } from "react";
import Link from "gatsby-link";
// This component pulls articles and lists them
class PostListing extends React.Component {
// This fetches the frontmatter from the .md files
getPostList() {
const postList = [];
this.props.postEdges.forEach(postEdge => {
@OllieJT
OllieJT / 0_reuse_code.js
Last active September 6, 2015 08:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console