Skip to content

Instantly share code, notes, and snippets.

View sidedwards's full-sized avatar
🇺🇸
Idaho, USA

Sid Edwards sidedwards

🇺🇸
Idaho, USA
View GitHub Profile
@sidedwards
sidedwards / gist:a818bb31cae3acaeccd92ef9f5f8dfd8
Created November 22, 2016 19:03
Scopeless Media query sass placeholder
$breakpoints: (sm:576px, md:768px, lg:992px, xl:1200px);
%button-reset {
$media: sm;
appearance: none;
border: none;
outline: none;
@each $screen-size, $breakpoint-value in $breakpoints {
@if ( index($media,$screen-size) ) {
@media (min-width: $breakpoint-value) {
# grc overides for ls
if $(gls &>/dev/null)
then
alias ls="gls -F --color"
alias l="gls -lAh --color"
alias ll="gls -l --color"
alias la='gls -A --color'
fi
# Easier CD navigation
@sidedwards
sidedwards / breadcrumbs.html
Created July 22, 2017 01:56
Breadcrumb navigation in Craft CMS
<div class="breadcrumbs">
<ul class="nav-list">
<li class="nav-item"><a href="/">Home</a></li>
{% set totalCrumbs = craft.request.getSegments() | length %}
{% for crumb in craft.request.getSegments() %}
{% if loop.index == totalCrumbs %}
<li class="nav-item"><a href="{{craft.request.getUrl()}}">{{crumb | capitalize}}</a></li>
{% else %}
<li class="nav-item"><a href="{{craft.request.getUrl() | split('/' ~ craft.request.getSegment(loop.index + 1))[0]}}">{{crumb | capitalize}}</a></li>
{% endif %}
@sidedwards
sidedwards / description.md
Last active December 3, 2018 09:31
Hide Sidebar in Craft 3 Control Panel

Hide sidebar in Craft 3 _layouts/cp

Snippet for hiding the sidebar in the Craft 3 control panel for Element index pages.

Since the Craft 3 sidebar handles the index source for querying elements it can be tricky disabling the sidebar and still executing the query.

This uses a twig macro to duplicate the sidebar and hide it while still being able to pass an index source for the query.

See the Craft templates/_layouts/cp.html file for more layout information

@sidedwards
sidedwards / newJournalEntry.js
Last active March 6, 2024 18:47
Journal Template for Trilium Notes. https://github.com/zadam/trilium
api.addButtonToToolbar({
title: 'New Journal Entry',
icon: 'book',
shortcut: 'alt+j',
action: async function() {
const todayDateStr = api.formatDateISO(new Date());
const todayEntry = await api.runOnServer(async todayDateStr => {
return await api.getDateNote(todayDateStr);
}, [todayDateStr]);
@sidedwards
sidedwards / boxfile.yml
Created March 26, 2019 00:36
Nanobox boxfile.yml for Sage 9 Wordpress
run.config:
engine: php
engine.config:
runtime: php-7.2
extensions:
- gd
- mysqli
- curl
- zlib
- mbstring

Translations Upgrade Workflow (3.1 => 3.2)

Important Notes:

Craft 3.2 introduces a new Draft service that allows drafts to be created for all elements instead of being Entry specific. Unfortunately, with this new draft service the original draftIds from the entrydrafts table are not retained. Due to this fundamental restructuring of how Craft handles its Drafts, we are unable to retain any drafts created with previous versions of the plugin.

We apologize and understand the inconvenience, and did everything we could to prevent this scenario, but due to the nature of this change in Craft, we were unable to preserve existing drafts.

We strongly recommend completing all existing translation orders and publishing their drafts prior to upgrading. If you're unable to complete these orders, please reference this gist which will show you how to [create a list of Entries along with their target sites](https://gist.g

by GTP-3
Philosophers have been trying for decades to make computers think like humans. The problem is that there is no good way to do it, since human thinking involves concepts like intentionality, agency, and so forth. If you try to program a computer with these things, it will never work right. Even if you could get a computer to understand what you were saying, it would still probably interpret your words incorrectly or completely ignore them entirely. You might as well be talking to a brick wall.
But then something strange happened recently. A team of researchers at Google DeepMind published a paper about their attempts to teach a computer to think like a philosopher. They called it GPT-1, and it described how they had built an AI system that could learn philosophical ideas by reading texts written by philosophers. It took them five years to train the system, and it eventually learned some very complex ideas about logic, metaphysics, and epistemology.
The idea behind this approach is that philosophy i
@sidedwards
sidedwards / input.scss
Created September 11, 2020 01:53
Generated by SassMeister.com.
h3 {
font-size: 20px;
margin-bottom: 10px;
.some-parent-selector & {
font-size: 24px;
margin-bottom: 20px;
}
}
@sidedwards
sidedwards / 00-instructions.md
Created July 13, 2021 20:22
Discord Daily Quote

Description

A script that posts a daily quote and image to Discord via webhook.

Setup

  1. Install deno
  2. Create a new Discord webhook, copy URL, and update webhookURL value.
  3. Create a Pexels account, generate an API key, and update pexelsAPIKey value.

Usage

  1. Manually run deno run --allow-net daily-quote.ts