Skip to content

Instantly share code, notes, and snippets.

View jesseleite's full-sized avatar

Jesse Leite jesseleite

View GitHub Profile
@jesseleite
jesseleite / form.antlers.html
Created January 13, 2025 21:55
Pull specific fields from `fields` loop in Statamic
{{ fields = fields | key_by('handle') }}
<div>
{{ fields.name.display }}
{{ fields.name.field }}
</div>
<div>
{{ fields.email.display }}
{{ fields.email.field }}
@jesseleite
jesseleite / test-hangup.sh
Created November 28, 2024 17:31
Test script to see how often phpunit receives hangup signal
#!/bin/bash
if [ -z "$1" ]; then echo 'Please specify test file!'; exit 1; fi
failures=0
attempts=0
while true; do
cmd="./vendor/bin/phpunit --colors $1"
$cmd
@jesseleite
jesseleite / mini-statusline.lua
Created October 9, 2024 14:39
mini.statusline config example
return {
'echasnovski/mini.statusline',
dependencies = {
'echasnovski/mini.icons',
},
config = function()
local noirbuddy_statusline = require('noirbuddy.plugins.mini-statusline')
require('mini.statusline').setup {
content = {
@jesseleite
jesseleite / toggle_surrounding_quote_style.lua
Created December 21, 2023 04:53
Toggle surrounding quote style mapping in Neovim (probably not perfect lol!)
local toggle_surrounding_quote_style = function ()
local current_line = vim.fn.line('.')
local next_single_quote = vim.fn.searchpos("'", 'cn')
local next_double_quote = vim.fn.searchpos('"', 'cn')
if next_single_quote[1] ~= current_line then
next_single_quote = false
end
if next_double_quote[1] ~= current_line then
@jesseleite
jesseleite / minimal.lua
Created April 13, 2022 17:12
Minimal nvim config for nvim-treesitter testing
vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
require('packer').startup {
{
'wbthomason/packer.nvim',
{
'nvim-treesitter/nvim-treesitter',
function! ShtuffStrategy(cmd)
call system("shtuff into test " . shellescape("clear;" . a:cmd))
endfunction
let g:test#custom_strategies = {'shtuff': function('ShtuffStrategy')}
let g:test#strategy = "shtuff"
@jesseleite
jesseleite / SelectModifier.php
Created February 21, 2019 17:06
Statamic v2 array batch addon idea
<?php
namespace Statamic\Addons\ArrayBatch;
use Statamic\Extend\Modifier;
class SelectModifier extends Modifier
{
/**
* Modify a value
<template>
<div class="tooltip-component" @mouseenter="show" @mouseleave="hide">
<div class="tooltip" :class="{ visible: isVisible }">
<span class="tooltip-text">{{ text }}</span>
</div>
<slot></slot>
</div>
</template>
<script>
Homebrew build logs for [email protected] on macOS 10.13.3
Build date: 2018-03-31 21:54:39
@jesseleite
jesseleite / sendString.js
Last active March 26, 2018 00:17
Digital Ocean console sendString() for pasting
var sendString = (function(rfb, force, sendDelay) {
sendDelay = sendDelay || 25;
var _q = [];
var _qStart = function() {
var chr = _q.shift();
if (chr) {
rfb.sendKey(chr);
setTimeout(_qStart, sendDelay);
}
};