Skip to content

Instantly share code, notes, and snippets.

View raygesualdo's full-sized avatar

Ray Gesualdo raygesualdo

View GitHub Profile
@raygesualdo
raygesualdo / extract.mts
Created October 30, 2025 17:28
Using jscodeshift to extract information about a code base
import type { FileInfo, API, ASTNode } from 'jscodeshift'
export default function transformer(file: FileInfo, api: API) {
const j = api.jscodeshift
const root = j(file.source)
// Walk the AST, extract information about each file, and persist that information somewhere
return
}
@raygesualdo
raygesualdo / .zshrc
Last active October 10, 2025 20:20
Shell function for creating git worktrees
# Fn to pull git branch from remote when not checked out
pull_branch() {
branch=${1:-main}
git fetch origin "$branch":"$branch"
}
# Fn to create git worktrees quickly
#
# It accepts three parameters:
# - A branch name to create the worktree for (required)
@raygesualdo
raygesualdo / plugins.ts
Created November 21, 2024 17:33
Copy files after build with Rsbuild
import type { RsbuildPlugin } from '@rsbuild/core'
export function pluginCopyManifest({
gitSha,
}: {
gitSha: string
}): RsbuildPlugin {
return {
name: 'my-project:copy-manifest',
###########################################################################################
#
# Intake Formset
#
###########################################################################################
submission_save_path: _forms/intake/
filename_format: "{{ slug }}-{{ year }}{{ month }}{{ day }}-{{ hour }}{{ minute }}-{{ second }}"
@raygesualdo
raygesualdo / raven__modify_submission.php
Created August 5, 2014 13:28
Modify Submission Hook for Statamic's Raven
/*
|--------------------------------------------------------------------------
| Hook: Modify Submission
|--------------------------------------------------------------------------
|
| Allow submission modification by other add-ons with the ability to manipulate
| content of the submission. Has access to the success and config.
|
*/
<div class="social-media">
facebook: https://www.facebook.com/acmecorp
twitter: https://twitter/acmecorp
tumblr: https://www.tumblr.com/acmecorp
instagram: http://www.youtube.com/acmecorp
urbanspoon: http://www.urbanspoon.com/acmecorp
linkedin: https://www.linkedin.com/acmecorp
pinterest: https://www.pinterest.com/acmecorp
youtube: https://foursquare.com/acmecorp
foursquare: https://foursquare.com/acmecorp