Skip to content

Instantly share code, notes, and snippets.

View agentgill's full-sized avatar

Mike Gill agentgill

View GitHub Profile
@agentgill
agentgill / README.md
Created November 26, 2024 18:23 — forked from disler/README.md
Four Level Framework for Prompt Engineering
@agentgill
agentgill / understanding_fasthtml.md
Created September 14, 2024 22:07 — forked from jph00/understanding_fasthtml.md
Understanding FastHTML Components and Architecture - a Claude Conversation

Understanding FastHTML Components and Architecture

🧑 human (Aug 26, 2024, 03:52 PM)

What are the components of FastHTML, and how do they work together? What are some key things I need to understand to write idiomatic FastHTML apps?

🤖 assistant (Aug 26, 2024, 03:52 PM)

Based on the documentation provided, here are the key components of FastHTML and how they work together to create web applications:

  1. Core Components:

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

sfdx force:data:soql:query --query "SELECT Id FROM Flow WHERE Status = 'Obsolete'" --targetusername $USERNAME --usetoolingapi --resultformat csv > flowTodelete.csv
while read c; do
if [[ "$c" != "Id" && "$c" != "Your query returned no results." ]]
then
sfdx force:data:record:delete --sobjecttype Flow --sobjectid $c --targetusername $USERNAME --usetoolingapi
fi
done < flowTodelete.csv
rm flowTodelete.csv
@agentgill
agentgill / ReadFileData.cls
Created October 5, 2021 06:10 — forked from darkacer/ReadFileData.cls
Parse and read through Excel using LWC and Sheetjs
public with sharing class ReadFileData {
@AuraEnabled
public static String readFileFromRecord(String recordId) {
ContentDocumentLink contentDocumentLink = [
SELECT id, ContentDocumentId, ContentDocument.Description,
ContentDocument.Title, LinkedEntityId
FROM ContentDocumentLink
WHERE LinkedEntityId = '0017F00002nb4ktQAA'
LIMIT 1
];
@agentgill
agentgill / logging.js
Last active August 25, 2021 09:55
Subscriber to Platform Event using JSForce
var jsforce = require("jsforce");
require("dotenv").config();
var username = process.env.SFDC_USER;
var password = process.env.SFDC_PWD;
var conn = new jsforce.Connection({ loginUrl: "https://login.salesforce.com" });
conn.login(username, password, function (err, userInfo) {
const replayId = 13475880;
const replayExt = new jsforce.StreamingExtension.Replay(
process.env.EVENT_TYPE,
replayId
/**
* @File Name : Invocable Template
* @Description : Invocable can be called from Flow or other Apex such as Batch or Queuable
* @Author : agentgill
* @Group :
* @Last Modified By : agentgill
* @Last Modified On : 03-02-2021
* @Modification Log :
* Ver Date Author Modification
* 1.0 07/02/2020 agentgill Initial Version
# csv2xml.py
# FB - 201010107
# First row of the csv file must be header!
# example CSV file: myData.csv
# id,code name,value
# 36,abc,7.6
# 40,def,3.6
# 9,ghi,6.3
# 76,def,99
/**
@description - Universal Batch Apex Scheduler
@credit - https://th3silverlining.com/2014/02/02/salesforce-universal-batch-scheduling-class/
*/
global class BatchScheduler implements Schedulable {
global Database.Batchable<SObject> batchClass{get;set;}
global Integer batchSize{get;set;} {batchSize = 200;}
global void execute(SchedulableContext sc) {
@agentgill
agentgill / clean_code.md
Created August 14, 2020 11:30 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules