Skip to content

Instantly share code, notes, and snippets.

Jason Varga jasonvarga

Block or report user

Report or block jasonvarga

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View FieldOptionsTags.php
<?php
namespace Statamic\Addons\FieldOptions;
use Statamic\API\Fieldset;
use Statamic\API\Parse;
use Statamic\Extend\Tags;
class FieldOptionsTags extends Tags
{
View statamic2-vs-3.md

Tests run on a 2013 Macbook Pro with 2.8GHz Intel Core i7, 16 GB 1600 MHz DDR3 using Laravel Valet.

Statamic 2 with 5000 entries

On a template listing 10 posts sorted by date.

Concurrency 1

@jasonvarga
jasonvarga / ClickHandler.js
Created Feb 6, 2019
Vue component that handles single and double clicks
View ClickHandler.js
export default {
render() {
return this.$scopedSlots.default({});
},
data() {
return {
listener: null,
timer: null,
@jasonvarga
jasonvarga / aliases.sh
Created Jan 8, 2019
Turn off xdebug while running phpunit
View aliases.sh
# First, copy ext-xdebug.ini to ext-xdebug.ini.bak
alias xdebug-disable='echo "" > /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini'
alias xdebug-restore='cat /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini.bak > /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini'
function phpunit {
xdebug-disable
./vendor/bin/phpunit "$@"
xdebug-restore
}
View Factory.php
<?php
namespace App\Factories;
abstract class Factory
{
public function instance()
{
return $this;
}
@jasonvarga
jasonvarga / aliases
Last active May 2, 2017
Interchangeable "please" and "artisan" regardless of Laravel/Statamic project type.
View aliases
alias artisan='art_plz'
alias please='art_plz'
alias art='art_plz'
alias plz='art_plz'
function art_plz {
if [ -e artisan ]; then
php artisan "$@"
elif [ -e please ]; then
php please "$@"
@jasonvarga
jasonvarga / protect.md
Created Sep 23, 2016
Statamic 2 Content Protection
View protect.md

Protecting Content {#protecting-content}

You may protect your content from unwanted visitors with the protect variable. By setting this variable you can allow or deny people in various ways. There are a number of schemes used for protecting content:

The protect variable can be placed in a number of places:

View readme.md

Statamic Documentation

We allow users to contribute to the Statamic docs. The content is stored separate from the actual site so our users view and modify content but the site can be hidden.

Folder structure

/
|— /docs.statamic.com
|    |— statamic
View blade.md
title overview id
Laravel Blade
Blade is the templating engine supplied with Laravel. We think its neat and we won't even be offended if you want to use it. Here's how.
efa34b0d-b4c3-43fc-bb91-a6d331dc6026

The Blade Templating Language

You can find out how to use Blade, the templating language over on the Laravel docs.

@jasonvarga
jasonvarga / _readme.md
Last active Aug 29, 2015
Restricting an account to specific sections in the CP
View _readme.md

Simple Statamic CP edit restrictions

  • Add the hooks file to _add-ons/restrict_to/hooks.restrict_to.php.
  • Add the restrict_to tags field to your _config/bundles/member/fields.yaml.
  • To restrict pages, add them to the restrict_to field. eg. /blog, /calendar. They will only be allowed to edit pages that begin with this url.

Warning

If your member listing is visible, (it is by default), they can edit their own restricted pages.

You can’t perform that action at this time.