Skip to content

Instantly share code, notes, and snippets.

View AugustMiller's full-sized avatar
🌳

August Miller AugustMiller

🌳
View GitHub Profile
@aaronbushnell
aaronbushnell / README.md
Last active February 1, 2024 20:48
🗓 Setting up omnilight/yii2-scheduling for flexible Craft task scheduling

📦 Installation

  1. Run composer require omnilight/yii2-scheduling to install the scheduling package
  2. Setup a config/schedule.php file to house your scheduled processes
  3. Modify your config/app.php to include the schedule component details to run the Craft command (instead of yii)
  4. Run php craft schedule/run --scheduleFile=@config/schedule.php to process any scheduled operations.

💡 Tip: You likely want to run php craft schedule/run --scheduleFile=@config/schedule.php on a cron job that fires every minute!

🙏 Credits

@samhernandez
samhernandez / UploadProfileWithBase64AvatarController.php
Last active November 4, 2021 14:55
Upload base64 image from front-end profile form with CraftCMS
<?php
use craft\base\Element;
use craft\db\Query;
use craft\db\Table;
use craft\elements\Asset;
use craft\elements\Entry;
use craft\errors\ImageException;
use craft\helpers\Assets;
use craft\helpers\FileHelper;
@jeromecoupe
jeromecoupe / deploy.yaml
Last active August 2, 2023 16:41
Github actions: build and deploy Craft sites (WIP)
name: Craft CMS deployments
on:
push:
branches: [master]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
@KatieMFritz
KatieMFritz / craft3-ax.md
Last active November 15, 2019 14:13
Craft 3 plugins for author experience

Craft 3 plugins for better author experience

Annotated Notes: For admin notes with automatic timestamps.

Control Panel Body Classes: Add body classes to various Control Panel screens for easier styling (in combination with Control Panel CSS).

Control Panel CSS: To make style tweaks to the control panel. See web/cp.css for styles.

Control Panel Nav: Custom navigation menus for each user type, for easier navigation.

@johannaratliff
johannaratliff / learning-golang.md
Last active June 13, 2024 21:43
Golang Rampup

Context

This is for programmers who want to ramp on Go, without resources that reiterate programming fundamentals. This would not be a good list of resources for folks who are learning to program using Go as their first language. Some resources that I dismiss here would be super valuable for newer folks. This is a selection of resources for those who understand programming fundamentals in a different language already.

Advice

  1. First steps = Tour of Go
  2. Don't waste time on Go Fundamentals-type books - it all lives in tour of Go.
  3. Consider joining the Gophers Slack
  4. When you need help, the Go Playground allows you make a quick scratch file and share it. Others trying to help can run your code easily this way.
@piotrpog
piotrpog / Craft CMS - URL macro
Last active March 4, 2019 14:26
This macro fetches routes into Twig template. More info on http://craftsnippets.com/articles/url-macro
{# v2 #}
{% macro url(routeName, tokens) %}
{% spaceless %}
{% set keyword = 'name' %}
{% set routeString = null %}
{% for route, routeSettings in craft.app.routes.getConfigFileRoutes %}
{% if routeSettings[keyword] is defined and routeSettings[keyword] == routeName %}
{% set routeString = route %}
{% endif %}
@ostark
ostark / EventCatcher.php
Created September 27, 2018 16:56
A wildcard event handler that logs all Yii/Craft events
class EventCatcher
{
/**
* @var array
*/
protected $classConstants = [];
public function __invoke(yii\base\Event $event)
{
@gricard
gricard / webpack4upgrade.md
Last active February 29, 2024 20:23
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2
@cham11ng
cham11ng / LEPP.md
Last active September 23, 2023 10:01
LEPP Setup - Ubuntu 16.04 LTS

A Relatively Secure Server Stack Setup in Ubuntu 16.04 LTS

Anup Dhakal

Sagar Chamling

Introduction

In this guide, LEPP stands for Linux, Nginx (pronounced as Engine-X) , Postgres and PHP (PHP Hypertext Preprocessor).