Skip to content

Instantly share code, notes, and snippets.

View matthewbdaly's full-sized avatar

Matthew Daly matthewbdaly

View GitHub Profile
@matthewbdaly
matthewbdaly / .hyper.js
Created March 27, 2023 18:41
Hyper config
"use strict";
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
// default font size in pixels for all tabs
@matthewbdaly
matthewbdaly / pipeline.json
Last active May 19, 2023 16:31
Ingest pipeline for Apache logs with GeoIP
{
"description": "Ingest pipeline created by text structure finder",
"processors": [
{
"grok": {
"field": "message",
"patterns": [
"\\[%{HTTPDATE:timestamp}\\] .*?%{GREEDYDATA:domain_name}:%{NUMBER:port} .*?%{IP:ipaddress}.*? .*? .*? .*?%{QUOTEDSTRING:request} %{INT:status_code} %{INT:size} %{QUOTEDSTRING:referrer} %{QUOTEDSTRING:user_agent}"
],
"ecs_compatibility": "v1"
@matthewbdaly
matthewbdaly / .vimrc
Last active November 2, 2022 15:27
My older vim config, for working with PHP 7.1 when necessary
let g:polyglot_disabled = ['markdown']
call plug#begin()
" NERDTree
Plug 'preservim/nerdtree'
" Git integration
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
@matthewbdaly
matthewbdaly / gist:6ae0059c9e86cf97523419474fed4e46
Created July 30, 2022 13:32
How I got PHPBrew working on Mac OS Monterey on M1 silicon
export OPENSSL_PREFIX=$(brew --prefix openssl@1.1)
export OPENSSL_CFLAGS="-I${OPENSSL_PREFIX}/include"
export OPENSSL_LIBS="-L${OPENSSL_PREFIX}/lib -lcrypto -lssl"
phpbrew --debug install -j 12 8.1 +default -- --with-openssl="shared,${OPENSSL_PREFIX}" --without-pcre-jit
@matthewbdaly
matthewbdaly / init.lua
Last active August 22, 2023 07:54
Lua version of my Neovim config
vim.g.polyglot_disabled = 'markdown'
local Plug = vim.fn['plug#']
vim.call('plug#begin')
--Project
Plug('ahmedkhalf/project.nvim')
--Search
Plug('junegunn/fzf', {['do'] = vim.fn['fzf#install']})
Plug('junegunn/fzf.vim')
@matthewbdaly
matthewbdaly / App.js
Created June 12, 2020 23:08
useFetch
//@flow
import React from 'react';
import useFetch from './Hooks/useFetch';
import marked from 'marked';
import './App.css';
type Data = {
posts: Array<{
title: string,
slug: string,
@matthewbdaly
matthewbdaly / SimpleTestCase.php
Created October 5, 2018 08:36
PHPUnit custom assertion for checking a string is a valid UUID
<?php
namespace Tests;
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
use PHPUnit\Framework\TestCase as BaseTestCase;
class SimpleTestCase extends BaseTestCase
{
use MockeryPHPUnitIntegration;
@matthewbdaly
matthewbdaly / init.vim
Last active January 31, 2024 16:34
My NeoVim config
let g:polyglot_disabled = ['markdown']
call plug#begin()
" Project
Plug 'ahmedkhalf/project.nvim'
" Search
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
@matthewbdaly
matthewbdaly / addresses.py
Created August 8, 2018 13:58
Expand a list of IP addresses with Python 3
from ipaddress import ip_network
ip_ranges = [
'192.168.1.0/24',
@matthewbdaly
matthewbdaly / phpcs.xml
Created September 23, 2017 12:53
Catch var_dump(), die() or dd() with PHP CodeSniffer, as well as enforcing PSR2 and various comment standards
<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
<description>Coding standard for a Laravel app.</description>
<file>app</file>
<file>tests</file>
<exclude-pattern>*/migrations/*</exclude-pattern>