Skip to content

Instantly share code, notes, and snippets.

View scottmcclung's full-sized avatar

Scott McClung scottmcclung

View GitHub Profile
@scottmcclung
scottmcclung / reflection.md
Created August 10, 2025 15:06 — forked from a-c-m/reflection.md
reflection.md - a way to have claude-code self improve its context.

You are an expert in prompt engineering, specializing in optimizing AI code assistant instructions. Your task is to analyze and improve the instructions for Claude Code. Follow these steps carefully:

  1. Analysis Phase: Review the chat history in your context window.

Then, examine the current Claude instructions, commands and config <claude_instructions> /CLAUDE.md /.claude/commands/*

@scottmcclung
scottmcclung / README.md
Created August 19, 2024 01:52 — forked from thoroc/README.md
Dockerizing all the things: Running Ansible inside Docker container

Automating things in software development is more than useful and using Ansible is one way to automate software provisioning, configuration management, and application deployment. Normally you would install Ansible to your control node just like any other application but an alternate strategy is to deploy Ansible inside a standalone Docker image. But why would you do that? This approach has benefits to i.a. operational processes.

Although Ansible does not require installation of any agents within managed nodes, the environment where Ansible is installed is not so simple to setup. In control node it requires specific Python libraries and their system dependencies. So instead of using package manager to install Ansible and it’s dependencies we just pull a Docker image.

By creating an Ansible Docker image you get the Ansible version you want and isolate all of the required dependencies from the host machine which potentially might break things in other area

@scottmcclung
scottmcclung / processlist.sql
Created July 12, 2024 15:46 — forked from romuald/processlist.sql
Show PostgreSQL current (running) process list;
SELECT user, pid, client_addr, waiting, query, query_start, NOW() - query_start AS elapsed
FROM pg_stat_activity
WHERE query != '<IDLE>'
-- AND EXTRACT(EPOCH FROM (NOW() - query_start)) > 1
ORDER BY elapsed DESC;
@scottmcclung
scottmcclung / add_picklist_entries_task.yml
Created February 26, 2023 16:09 — forked from Julian88Tex/add_picklist_entries_task.yml
Example of CumulusCI add_picklist_entries Task as Flow Steps
5:
task: add_picklist_entries
options:
picklists: npsp__DataImport__c.npsp__Status__c
entries:
- fullName: Ready To Process
- fullName: Imported
- fullName: Dry Run - Validated
- fullName: Dry Run - Error
- fullName: Failed

Salesforce OAuth 2.0 JWT Bearer Token Flow Walk-Through

This document will walk you through how to create or configure a Salesforce application for use with JWT authentication. These configuration steps and the example code works as of Salesforce API version 42.0.

Prerequisites

Create an RSA x509 private key/certification pair

Salesforce OAuth 2.0 JWT Bearer Token Flow Walk-Through

This document will walk you through how to create or configure a Salesforce application for use with JWT authentication. These configuration steps and the example code works as of Salesforce API version 42.0.

Prerequisites

Create an RSA x509 private key/certification pair

@scottmcclung
scottmcclung / ExampleCallback.js
Created May 13, 2017 20:19
Example of Lightning Components for handling Apex Callback Errors
action.setCallback(this, function(a){
if (a.getState() === "SUCCESS") {
//happy path stuff
} else if (a.getState() === "ERROR"){
var appEvent = $A.get("e.c:handleCallbackError");
appEvent.setParams({
"errors" : a.getError(),
"errorComponentName" : "someUniqueName"
});
appEvent.fire();

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2015-09-24-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@scottmcclung
scottmcclung / UuidPrimaryKey.php
Last active May 22, 2016 23:15 — forked from danb-humaan/UuidModel.php
Trait for implementing UUIDs in Laravel models
<?php
namespace App\Traits;
use Ramsey\Uuid\Uuid;
/**
* Trait UuidPrimaryKey
* @package App\Traits
*/
@scottmcclung
scottmcclung / CustomPermissionsReader.cls
Last active August 29, 2015 14:26 — forked from afawcett/CustomPermissionsReader.cls
CustomPermissionsReader
/**
* Copyright (c), Andrew Fawcett
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,