Skip to content

Instantly share code, notes, and snippets.

View anupj's full-sized avatar
:octocat:
❤️ 🦀

Anup Jadhav anupj

:octocat:
❤️ 🦀
View GitHub Profile
@montasaurus
montasaurus / llmc.sh
Last active March 31, 2024 18:59
AI Shell Command Generator
llmc() {
local system_prompt='Output a command that I can run in a ZSH terminal on macOS to accomplish the following task. Try to make the command self-documenting, using the long version of flags where possible. Output the command first enclosed in a "```zsh" codeblock followed by a concise explanation of how it accomplishes it.'
local temp_file=$(mktemp)
local capturing=true
local command_buffer=""
local first_line=true
local cleaned_up=false # Flag to indicate whether cleanup has been run
cleanup() {
# Only run cleanup if it hasn't been done yet
@veekaybee
veekaybee / normcore-llm.md
Last active April 19, 2024 02:49
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@LukeMathWalker
LukeMathWalker / audit.yml
Last active April 19, 2024 06:56
GitHub Actions - Rust setup
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@anupj
anupj / Convert15To18
Last active December 30, 2015 17:49
Convert Salesforce's 15 character id to 18 character Id See here for context: http://salesforce.stackexchange.com/questions/1653/what-are-salesforce-ids-composed-of
// Converts 15 char salesforce id to 18 char id
static String convertto18CharId(String original15charId){
if(original15charId == null || original15charId.isEmpty()) return null;
original15charId = original15charId.trim();
if(original15charId.length() != 15) return null;
final String BASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456";
StringBuilder result = new StringBuilder();
@noeticpenguin
noeticpenguin / RestClient.java
Created October 21, 2013 13:05
A basic Rest Client for Salesforce's Apex
Public with sharing virtual class RestClient {
Public class RestClientException extends Exception {}
/*
* class variable creation - DO NOT EDIT
*/
Public Map<String,String> headers;
Public String url;
Public String method;
@jeffdonthemic
jeffdonthemic / ChatterUtils
Last active April 1, 2019 00:21
Simple Class to add Salesforce Chatter posts with links, urls and mentions.
public with sharing class ChatterUtils {
// makes a simple chatter text post to the specified user from the running user
public static void simpleTextPost(Id userId, String postText) {
ConnectApi.FeedType feedType = ConnectApi.FeedType.UserProfile;
ConnectApi.MessageBodyInput messageInput = new ConnectApi.MessageBodyInput();
messageInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
@wuservices
wuservices / emailTemplates.anonymous.apex
Created December 7, 2011 23:30
Generating package.xml snippet to get email templates to Force.com IDE Winter '12
// Derived from http://paulbattisson.com/?p=80
String output = '\n<types>\n';
List<EmailTemplate> templates = [Select e.FolderId, e.DeveloperName From EmailTemplate e];
Map<Id, Folder> folders = new Map<Id, Folder>([Select f.Id, f.DeveloperName From Folder f where f.DeveloperName != null]);
Set<Id> folderIds = new Set<Id>();
folderIds.addAll(folders.keySet());
for (EmailTemplate template: templates) {
if (folders.keySet().contains(template.FolderId)) {