Skip to content

Instantly share code, notes, and snippets.

View kevinwestern's full-sized avatar

Kevin Western kevinwestern

View GitHub Profile

Trying out LLMs

I believe LLMs will make me a more productive software engineer, but old habits die hard. I wanted to scratch an itch this weekend by answering “What is the Model Context Protocol? How can I use it?”. I used an LLM to do it.

I wanted to try out Claude by building a simple Model Context Protocol (MCP) and having the LLM help me write it. I’ve used Google’s Gemini in the past. I had it generate some statistical functions. It was so good that I immediately paid for the more advanced capabilities. I believe the time it saves is worth my money.

The Model Context Protocol is something new to me. I have been indifferent to LLM-assisted engineering for no particular reason. What is the Model Context Protocol? My naive, limited-experience summary is that it’s a way to dynamically inject data and context to an LLM. Imagine integrating APIs into LLM responses.

The MCP quickstart builds a weather fetching API. I’m not passionate about weather, but

@kevinwestern
kevinwestern / gist:069dc781d520d5218f799f1241779978
Created March 11, 2024 02:48
Delete reddit comments shown on your profile, from your profile page
window.getCSRF = () => document.cookie.split('; ').find(s => s.indexOf('csrf_token') === 0).substring('csrf_token='.length)
function deleteComment(id) {
fetch("https://www.reddit.com/svc/shreddit/graphql", {
"method": "POST",
"headers": {
"accept": "application/json",
"content-type": "application/json",
},
"body": JSON.stringify({

Keybase proof

I hereby claim:

  • I am kevinwestern on github.
  • I am kestern (https://keybase.io/kestern) on keybase.
  • I have a public key ASCQ2RlgTDWHMFGSnMoOQdYSOCwJtWzcc_3SqHoWfrEhDgo

To claim this, I am signing this object:

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
// Calculator.java
public class Calculator {
public Calculator() {
}
public int add(int num1, int num2) {
return num1 + num2;
}
}
@kevinwestern
kevinwestern / angular-indexeddb.js
Created May 10, 2014 19:30
Angular indexedDB
// Code goes here
var myApp = angular.module('myApp', ['ngResource']);
myApp.factory('indexedDB', ['$window', '$q', function($window, $q) {
var version = 2;
var indexedDB = $window.indexedDB;
var request = indexedDB.open('myapp', version);
var db = null;
var defer = $q.defer();
function thisIsOk() {
var name = getName();
var age = getAge();
if (age < 21) {
console.log("You're too young!");
} else {
console.log("Come on in!");
}
}
@kevinwestern
kevinwestern / _.md
Created October 31, 2013 15:34
Tributary inlet
@kevinwestern
kevinwestern / _.md
Created October 29, 2013 22:20
schanges
var app = angular.module('apm', ['apm.controller']);
app.config(['$routeProvider', function($routeProvider) {
alert('test');
$routeProvider.when('/', {
controller: 'HomeCtrl',
template: '/static/templates/home.ng'
}).otherwise({redirectTo: '/'});
}]);