Skip to content

Instantly share code, notes, and snippets.

View justrjlewis's full-sized avatar

RJ Lewis justrjlewis

View GitHub Profile
<?php
/**
* Simple Example of a client calling WordPress OAuth Server
* Replace the variabls below with your own.
*
* @author Justin Greer <justin@justin-greer.com>
*/
$server_url = 'https://wordpress.dev';
$client_id = '6lkmsGocFcvxVG4S5s3QCHGi5Pvutl8AHtXaalmP';
$client_secret = 'yRntyrmDTquw7bOd0kHuFQ5mj2wtnSjVKGpi8MW2';
@justrjlewis
justrjlewis / functions.php
Created September 2, 2018 21:36 — forked from cliffordp/functions.php
Event Tickets Plus: WooCommerce: Force all tickets to be "Sold Individually".
<?php
/**
* Event Tickets Plus: WooCommerce: Force all tickets to be "Sold Individually".
*
* By default, this limits the purchase quantity to 1, but this is quantity is
* filterable with `woocommerce_add_to_cart_sold_individually_quantity`.
*
* @see Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_event_for_ticket()
* @see WC_Product::is_sold_individually()
* @see WC_Cart::add_to_cart()
<?php
/* Tribe, limit ticket qty */
function tribe_limit_tickets() {
?>
<script type="text/javascript">
jQuery(document).ready( function( $ ) {
// do this if tickets available
if ( $('.tribe-events-tickets').length ) {
// set max qty to 1
@justrjlewis
justrjlewis / partial-speaker.html
Created July 6, 2016 13:55
hugo taxonomy array iteration partial
<!-- speaker bios -->
{{ with .Params.speakername }}
<hr />
<div style="margin-bottom: 25px;">
<p style="color:rgba(159, 0, 1, 1); margin-top:10px; text-transform:uppercase;">
<span style="border-bottom: 1px solid;">presenter information</span>
</p>
{{ range $index, $element := $.Params.speakername }}
{{ if gt (len $.Params.speakername) 0 }}
@justrjlewis
justrjlewis / footer.html
Created February 20, 2016 23:29
boilerplate
// ==UserScript==
// @name trello list colors
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Highlight certain columns in Trello.
// @author RJ Lewis
// ==/UserScript==
$(document).ready(function() {
@justrjlewis
justrjlewis / sysctl.conf
Created January 20, 2016 17:44
Bind to lower ports on freebsd
# add to: /etc/sysctl.conf
net.inet.ip.portrange.reservedlow=0
net.inet.ip.portrange.reservedhigh=0
security.mac.portacl.port_high=1023
security.mac.portacl.suser_exempt=1
security.mac.portacl.rules=uid:[uid for desired user]:tcp:80,uid:[uid for desired user]:tcp:443
@justrjlewis
justrjlewis / caddy-updated.in.sh
Last active November 25, 2018 01:48
Run caddy server as a service: FreeBSD 10.2
#!/bin/sh
# PROVIDE: caddy
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Documentation=https://caddyserver.com/docs
# add php-fpm to REQUIRE to run php/fastcgi processes
# Add the following lines to /etc/rc.conf to enable caddy:
/*!
=================================
Website by by RJ Lewis
Created **************
Last updated **************
- Build: **************
BG Pattern()
Courtesy of: subtlepatterns.com
=================================
Contents:
@justrjlewis
justrjlewis / code-1.php
Created June 1, 2015 20:23 — forked from hissy/code-1.php
Concrete5 5.7 Pagination
<?php if ($showPagination): ?>
<?php echo $pagination;?>
<?php endif; ?>