Skip to content

Instantly share code, notes, and snippets.

Avatar
🗿

Leevi Graham leevigraham

🗿
View GitHub Profile
@leevigraham
leevigraham / AbstractRepository.php
Last active Apr 18, 2018
AbstractRepository::filterByCriteria - Parses a nested array and adds expressions to a query builder
View AbstractRepository.php
<?php
namespace App\Doctrine\ORM\Repository;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\QueryBuilder;
abstract class AbstractRepository extends ServiceEntityRepository
{
/**
@leevigraham
leevigraham / example.html
Last active Oct 18, 2018
Renderless Flyout.Vue component
View example.html
<flyout v-cloak>
<div slot-scope="props">
<button
v-on:click="props.toggle()"
v-bind:class="'border-2 p-1 ' + (props.isActive ? 'bg-green': 'bg-red')"
data-reference
></button>
<div
v-show="props.isActive"
class="list-reset bg-white border p-4 shadow z-10"
View flyout.vue
<template>
<div>
<div ref="trigger">
<slot name="trigger"
v-bind:isActive="isActive"
v-bind:toggle="toggle"
>
<button v-on:click="toggle">Toggle</button>
</slot>
</div>
@leevigraham
leevigraham / example.php
Last active Apr 8, 2018
Support for verb requests in craftcms v2
View example.php
<?php
// Example in your plugin file
public function registerSiteRoutes(): array {
return [
'api/.*+' => ['action' => 'nCIG/preFlight', 'verb' => 'OPTIONS'],
];
}
View Lets Encrypt Domains
DOMAIN.buildbox.newism.com.au,
www.DOMAIN.buildbox.newism.com.au,
dev.DOMAIN.buildbox.newism.com.au,
stage.DOMAIN.buildbox.newism.com.au,
master.DOMAIN.buildbox.newism.com.au
@leevigraham
leevigraham / Generate ssl certificates with Subject Alt Names on OSX.md
Last active Oct 20, 2020
Generate ssl certificates with Subject Alt Names
View Generate ssl certificates with Subject Alt Names on OSX.md

Generate ssl certificates with Subject Alt Names on OSX

We're going to generate a key per project which includes multiple fully qualified domains. This key can be checked into the project repo as it's intended for local development but never used on production servers.

Save ssl.conf to your my_project directory.

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

View pipeline.sh
#!/bin/bash
set -eu
echo "steps:"
echo "
- label: \":hammer: dev\"
command: |-
source .env
View pipeline.sh
#!/bin/bash
set -eu
echo "steps:"
echo "
- label: \":hammer: dev\"
command: |-
source .env
View gmap_field.js
/**
* Google Maps for ExpressionEngine v3
*
* @package Google Maps for ExpressionEngine
* @subpackage Javascript
* @category Fieldtype
* @author Justin Kimbrell
* @copyright Copyright (c) 2012, Objective HTML
* @link http://www.objectivehtml.com/google-maps
* @version 3.3.0
You can’t perform that action at this time.