Skip to content

Instantly share code, notes, and snippets.

View elivz's full-sized avatar

Eli Van Zoeren elivz

View GitHub Profile
{if logged_in}
{preload_replace:entry_status='open'}
{if:else}
{preload_replace:entry_status='closed'}
{/if}
{exp:channel:entries status="{entry_status}"}
...
{/exp:channel:entries}
@elivz
elivz / twig-calendar.twig
Created June 20, 2015 04:17
Event calendar using Craft & Twig
{% set allEvents = craft.entries('events') %}
{% for month, events in allEvents|group('startDate|date("F Y")') %}
{% set eventsByDate = events|group('startDate|date("j")') %}
<section id="{{ month|slugify }}" class="month{% if loop.first %} currentMonth{% endif %}">
<h1 class="monthName">{{ month }}</h1>
<div class="eventList">
<table class="calendar">
<thead>
@elivz
elivz / keybase.md
Created June 2, 2015 19:13
Keybase proof

Keybase proof

I hereby claim:

  • I am elivz on github.
  • I am elivz (https://keybase.io/elivz) on keybase.
  • I have a public key whose fingerprint is 69E9 5FCB 5A09 8722 86AD DFFC 917F A52D BBB7 DC5B

To claim this, I am signing this object:

@elivz
elivz / gist:3837046
Created October 4, 2012 23:08 — forked from kmgdevelopment/gist:3836913
Average Rating Extension
<?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
@elivz
elivz / ext.store_discount.php
Created July 22, 2012 20:27
Exp:resso Store discount extension
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Store Discount Extension
*
* @package ExpressionEngine
* @subpackage Addons
* @category Extension
* @author Eli Van Zoeren
* @link http://elivz.com
@elivz
elivz / stripe_jquery.js
Created January 8, 2012 03:28
Stripe integration code
$(document).ready(function() {
// Load the Stripe script
$.getScript('https://js.stripe.com/v1/', function() {
Stripe.setPublishableKey('pk_MoKd7A4QHY6s7OJBXUghBQQN3uCT2');
$('#checkout').show();
});
var $form = $("form[name='checkout']").submit(function(event) {
// Disable the submit button to prevent repeated clicks
$('.submit').attr("disabled", true);
@elivz
elivz / wordpress-w3tc-site.conf
Created March 20, 2011 18:06
Nginx configuration for WordPress with W3 Total Cache plugin. See http://elivz.com/blog/single/wordpress_with_w3tc_on_nginx/
server {
# Redirect yoursite.com to www.yoursite.com
server_name yoursite.com;
rewrite ^(.*) http://www.yoursite.com$1 permanent;
}
server {
# Tell nginx to handle requests for the www.yoursite.com domain
server_name www.yoursite.com;