Skip to content

Instantly share code, notes, and snippets.

View agentgill's full-sized avatar

Mike Gill agentgill

View GitHub Profile
@disler
disler / README.md
Last active October 9, 2025 04:19
Four Level Framework for Prompt Engineering
@jph00
jph00 / understanding_fasthtml.md
Last active September 12, 2025 06:29
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:
@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
];
@amitastreait
amitastreait / UploadFile.js
Created April 7, 2021 08:12
Custom File Uploader using Lightning Web Component
import { LightningElement, api } from 'lwc';
import saveTheChunkFile from '@salesforce/apex/FileUploadService.saveTheChunkFile';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
const MAX_FILE_SIZE = 4500000;
const CHUNK_SIZE = 750000;
export default class UploadFile extends LightningElement {
@api recordId;
fileName = '';
/**
@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

@JitendraZaa
JitendraZaa / BatchApexFramework.cls
Last active October 30, 2023 11:54
Framework to fix - Salesforce Governor Limit of 100 jobs in Flex Queue
/**
* @Author : Jitendra Zaa
* @Date : Apr 21 2019
* Framework to fix limit of 100 Batch Apex in Queue
* */
public class BatchApexFramework implements Schedulable{
private static Integer availableBatchLimit = null;
import { LightningElement } from 'lwc';
export default class ComponentA extends LightningElement {
fireEvent() {
// Fire DOM custom event
const customEvt = new CustomEvent('custom');
this.dispatchEvent(customEvt);
}
}
{
"version": "2.0.0",
"tasks": [
{
"label": "SFDX: Deploy Current File",
"type": "shell",
"command": "sfdx",
"args": [
"force:source:deploy",
"--sourcepath",
@davidmreed
davidmreed / simple-salesforce-jwt.py
Created January 15, 2019 01:32
Using simple_salesforce with JWT authentication
import jwt
import requests
import datetime
from simple_salesforce import Salesforce
from simple_salesforce.exceptions import SalesforceAuthenticationFailed
def jwt_login(consumer_id, username, private_key, sandbox=False):
endpoint = 'https://test.salesforce.com' if sandbox is True else 'https://login.salesforce.com'
jwt_payload = jwt.encode(
{