Skip to content

Instantly share code, notes, and snippets.

View mwiater's full-sized avatar
💭
10010100010100100100101

Matt J. Wiater mwiater

💭
10010100010100100100101
View GitHub Profile
@mwiater
mwiater / peekr.go
Created November 11, 2023 21:22
Excerpt from github.com/mwiater/golangpeekr
// PackageFunctions retrieves a map of FunctionInfo slices indexed by file path.
// It scans the specified package directory for Go files and extracts metadata
// for each exported function.
func PackageFunctions(dir, pkgName string) (map[string][]FunctionInfo, error) {
fset := token.NewFileSet() // Create a new file set for parsing.
funcMap := make(map[string][]FunctionInfo) // Initialize a map to store function information.
// Walk the directory tree recursively to find Go files.
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
if err != nil {
@mwiater
mwiater / gist:09689a1ec0cbd88bacac04a7182ee30e
Created September 22, 2023 23:19
Pprof: Analyzing Concurrent Goroutines
File: imageprocessing
Type: cpu
Time: Sep 22, 2023 at 11:40am (PDT)
Duration: 1.03s, Total samples = 2.77s (270.11%)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) list ProcessImageSharpenOptimized|sharpenConcurrent
Total: 2.77s
ROUTINE ======================== imageprocessing/sharpening.go
0 610ms (flat, cum) 22.02% of Total
. . 54:func ProcessImageSharpenOptimized(inputPath string, outputPath string) (int64, error) {
This file has been truncated, but you can view the full file.
CREATE DATABASE IF NOT EXISTS `movies` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `movies`;
-- MySQL dump 10.13 Distrib 8.0.20, for Win64 (x86_64)
--
-- Host: mjw-vm-ml Database: mjw
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-- MySQL dump 10.13 Distrib 8.0.20, for Win64 (x86_64)
--
-- Host: mjw-vm-ml Database: movies
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;