Skip to content

Instantly share code, notes, and snippets.

var metalSmith = require('metalsmith');
var myPlugin = function(files, metalsmith, done){
/*
files param looks like this
{
'path/to/file.html': {
// yaml front matter data from md file here (foo and whatever)
foo: 'bar',
@clineamb
clineamb / app.js
Last active June 6, 2018 01:53
[DEPRECIATED] Nunjucks 1.0.7 + Express 4.9.2
/*
* Nunjucks + Express
* I couldn't find anything that helped me setup the enviornment
* correctly for these in the latest vesion of Express 4 (at the time
* of writing this).
*
* This Gist for those that want to keep using Nunjucks with Express 4.
* This also goes over working with a Nunjucks environment to use custom
* filters, extensions, etc.
*
@croxton
croxton / cpanel_vps_eecms_config.md
Last active September 5, 2021 23:34
Battle-tested cPanel VPS server configuration for medium traffic ExpressionEngine websites

"Medium traffic" = able to handle around 50 concurrent users on average.

If you want to handle 100+ concurrent users with the same modest hardware see the Varnish section below.

VPS

  • 4096 MB memory
  • 125GB SSD
  • 4 CPUs
  • Cpanel
@andrewdelprete
andrewdelprete / laracon-2014-notes.md
Last active November 19, 2018 17:19
My notes from Laracon 2014

###Jeffrey Way (1) - Bootcamp

Jeffrey went through about 12 subjects one right after the other and gave tips along the way.

  1. Mail Drivers for mail notifications.
1. With Laravel 4.2 it’s easier to use APIs like Mailgun and Mandrill for e-mail notifications. This avoids using SMTP which is really cool.
  1. File Generators for generating schema migrations.
@jawinn
jawinn / current_page_share.php
Last active June 1, 2016 20:22
Share Current Page via Facebook
<?php
/**
* Get the current Url taking into account Https and Port
* @link http://css-tricks.com/snippets/php/get-current-page-url/
* @version Refactored by @AlexParraSilva
*/
function getUrl() {
$url = isset( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] ? 'https' : 'http';
$url .= '://' . $_SERVER['SERVER_NAME'];
$url .= in_array( $_SERVER['SERVER_PORT'], array('80', '443') ) ? '' : ':' . $_SERVER['SERVER_PORT'];
@nathanpitman
nathanpitman / Auto Store SKU
Created March 28, 2014 16:23
Automatically populates the Expresso Store SKU field with the corresponding entry_id value on save if no custom value is specified.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* ExpressionEngine - by EllisLab
*
* @package ExpressionEngine
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2003 - 2011, EllisLab, Inc.
* @license http://expressionengine.com/user_guide/license.html
* @link http://expressionengine.com
@brandonkelly
brandonkelly / templating.md
Last active February 7, 2024 15:20
Templating in EE vs. Craft
@rstacruz
rstacruz / ansible.md
Last active April 8, 2024 23:36
Getting started with Ansible
@jasonvarga
jasonvarga / gist:7492322
Last active December 28, 2015 11:19
Bison and Stripe integration
<div id="payment-errors">
{{ bison:checkout_form_errors }}
{{ if missing }}
<p>You are missing the following fields.</p>
<ul>
{{ missing }}
<li>The {{ field_label }} field {{ message }}</li>
{{ /missing }}
</ul>
{{ endif }}
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.