Skip to content

Instantly share code, notes, and snippets.

View nathanp's full-sized avatar

Nathan Parikh nathanp

View GitHub Profile
@nathanp
nathanp / pathway.lava
Last active February 6, 2019 22:45
RockRMS - Discipleship Pathway
<div class="row">
<div class="col-sm-12">
<div class="persondetails-group">
<header>
<h1>Hallmark's Discipleship Pathway</h1>
</header>
</div><!-- .persondetails-group-->
</div>
<div class="panel panel-block">
<div class="panel-heading">
<h4 class="panel-title">Important Events</h4>
</div>
<div class="">
{% eventcalendaritem where:'EventCalendarId == 1' %}
<ul class="list-group list-group-panel">
{% for eventcalendaritem in eventcalendaritemItems %}
{% if eventcalendaritem.EventItem.IsActive == true %}
{% assign level = eventcalendaritem | Attribute:'EventLevel' %}
@nathanp
nathanp / Adult Connect Groups Count.lava
Last active November 11, 2019 16:47
RockRMS - Metric SQL and Lava
{% assign previousSunday = 'Now' | SundayDate | DateAdd:-7 | Date:'M/dd/yyyy' %}
Metric Date: {{ previousSunday }}
<br />
{% group where:'ParentGroupId == 49 || ParentGroupId == 10603 && IsActive == true' %}
{% for group in groupItems %}
{% attendance where:'DidAttend == true && GroupId == {{ group.Id }} && SundayDate == "{{ previousSunday }}"' count:'true' %}
{% if count > 0 %}
Metric Partition: {{ group.Name }}
<br />
Metric Value: {{ count }}
@nathanp
nathanp / dl-file.htaccess
Created April 5, 2017 18:49
Sample .htaccess configuration to use the dl-file.php from https://gist.github.com/nathanp/50e76eb23a3f084cce4205657ee71acc
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# BEGIN THIS DL-FILE.PHP ADDITION
@nathanp
nathanp / dl-file.php
Last active April 5, 2017 18:50
File that helps restrict access to uploads in a specific folder. Use in conjunction with .htaccess file - https://gist.github.com/nathanp/02a615fbc7e8bac6ca139c6c3bea38e7
<?php
/*
* dl-file.php
*
* Protect uploaded files with login.
*
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in
* @link https://gist.github.com/hakre/1552239
*
* @author Nathan Parikh <https://ndzynes.com/>