Skip to content

Instantly share code, notes, and snippets.

View inxilpro's full-sized avatar

Chris Morrell inxilpro

View GitHub Profile
@inxilpro
inxilpro / nginx-www.conf
Created February 16, 2018 16:36
nginx config
; /etc/nginx/conf.d/www.conf
server {
server_name www.mydomain.com;
index index.php;
root /var/www/public;
location / {
try_files $uri $uri/ /index.php?$query_string;
const _ = require('lodash');
const defaultConfig = require('tailwindcss/defaultConfig')();
const escape = require('tailwindcss/utils/escapeClassName');
const addUtilities = require('tailwindcss/utils/addUtilities');
const addComponents = require('tailwindcss/utils/addComponents');
export class PluginLoader
{
constructor(name, configOverrides, tailwindConfig) {
<?php
namespace Tests;
use Exception as RootException;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestCase;
<?php
$crawler = new Crawler($html);
$nodes = $crawler->filter('faux'); // Crawl <faux> tags
$nodes->each(function(Crawler $crawler) {
$node = $crawler->getNode(0);
$php = "@component('{$node->tagName}')";
@inxilpro
inxilpro / BabelBladeExtension.php
Created September 21, 2019 19:21
Blade Extension to transpile inline <script> tags using Babel (during the Blade compile step)
<?php
namespace App\Support\View;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Log;
use Illuminate\View\Compilers\BladeCompiler;
use Illuminate\View\Compilers\Concerns\CompilesEchos;
use RuntimeException;
use Symfony\Component\Process\Process;
@inxilpro
inxilpro / tailwind.config.js
Last active October 24, 2019 21:47
Example Tailwind custom logged-in and logged-out variants
const selectorParser = require('postcss-selector-parser');
module.exports = {
/* ... */
plugins: [
function({ addVariant }) {
addVariant('logged-out', ({ modifySelectors, separator }) => {
return modifySelectors(({ selector }) => {
return selectorParser(selectors => {
selectors.walkClasses(sel => {
export default function(babel) {
const { types: t } = babel;
return {
name: "inertia-babel-transform",
visitor: {
ExportDefaultDeclaration(path, state) {
const componentName = state.filename || "_";
path.replaceWith(
t.expressionStatement(
<?php
namespace Tests\Traits;
use Illuminate\Support\Facades\DB;
class RefreshDatabaseState
{
public static $hash_algo = 'md5';
<?php
/**
* @property string $annotated_string
* @property int $annotated_int
* @property float $annotated_float
* @property bool $annotated_bool
* @property boolean $annotated_boolean
*/
class ScaffoldingModel extends Model
{{ Aire::scaffold(Author::class) }}