Skip to content

Instantly share code, notes, and snippets.

View heymarkreeves's full-sized avatar

Mark Reeves heymarkreeves

View GitHub Profile
@fastdivision
fastdivision / author.html
Last active September 3, 2020 20:09
Jekyll Examples
<div class="byline author vcard">
<a class="photo" href="{% render_author url %}">
<img src="{% render_author avatar %}" alt="{{ page.author }}" title="{{ page.author }}">
</a>
<h2>{{ page.author }}</h2>
<div class="author-bio">
<p>{% render_author bio %}</p>
</div>
</div>
@magicznyleszek
magicznyleszek / jekyll-and-liquid.md
Last active January 12, 2024 03:46
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@joshcarr
joshcarr / window-height-width.js
Created July 3, 2014 00:04
vanilla JS window width and height
// vanilla JS window width and height
var w=window,
d=document,
e=d.documentElement,
g=d.getElementsByTagName('body')[0],
x=w.innerWidth||e.clientWidth||g.clientWidth,
y=w.innerHeight||e.clientHeight||g.clientHeight;
@heymarkreeves
heymarkreeves / gist:1fd9ba158694b6cc81d3
Last active August 29, 2015 14:07
Wanted: DevOps Guns for Hire

As a follow up to my tweet that started a discussion today (https://twitter.com/circa1977/status/520207883783663616), here's what I'm looking for:

  • A skilled DevOps team that's available to book for on-call slots. DevOps in my mind are different than SysAdmins. They don't balk at getting into PHP (or other) code as necessary. They know how the platforms we're using work.

  • High-availability: These folks are going to be getting alerts at 2:00am or on weekends. That's part of the job. A part of the job that I'm not up for. That's expensive, and making this affordable is a big part of the challenge.

  • High-reliability: The first time this team has to escalate an issue back to me while I'm somewhere with my family or sleeping, it's no longer worry-free and I'm not getting what I paid for. They have to be able to handle this stuff.

  • Non-competitive: I don't want to hire another dev shop that's also booking the same sorts of projects I do. They need to be focused on knowing the apps, understanding real world

@joshangell
joshangell / go-craft-go.sh
Last active January 26, 2021 00:48
Sets up a new Craft project in the ~/Sites folder with a bunch of plugins and boilerplate. Geared towards OSX users.
#!/bin/sh
printf "\e[34mEnter name for this site\e[0m\n"
read DOMAIN
if [ -z "$DOMAIN" ];
then
DOMAIN="${PWD##*/}"
fi
@DejanBelic
DejanBelic / templateFile.html.twig
Created February 25, 2017 07:13
Link other fields with link field in drupal 8.
{{ link(content.field_products_image, content.field_products_read_more[0]['#url'], { 'class':['class-link']} ) }}

systemd @ Arcustech

User level systemd setup - for things like laravel queue workers.

systemd is mainly used to manage services on modern linux distributions, but it also allows non-root users to manage services running under their own account. This makes systemd a great alternative to services like supervisord as it is able to detect crashes and automatically restarts the service.

Configuring a user unit

(1) The directory structure that holds unit files is similar to the systemwide configuration, but is located in a user's home directory:

@AugustMiller
AugustMiller / FrequentBuyer.php
Last active January 26, 2021 23:09
Reduces the current Cart/Order's total by some percentage of the combined total of the previous 6 orders.
<?php
namespace dpdx\plugin\adjusters;
use Craft;
use craft\base\Component;
use craft\helpers\ArrayHelper;
use craft\commerce\Plugin as Commerce;
use craft\commerce\base\AdjusterInterface;
use craft\commerce\elements\Order;