Skip to content

Instantly share code, notes, and snippets.

@samhavens
samhavens / llm_foundry_schema.json
Last active July 13, 2023 01:19
LLM Foundry Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"integrations": {
"type": "array",
"items": {
@samhavens
samhavens / mpt_privacy_policy.md
Created May 5, 2023 07:14
MPT Privacy Policy

Privacy Policy

By using this service, you acknowledge and agree to the terms set forth in this Privacy Policy. Your continued use of the service constitutes your acceptance of any changes to the Privacy Policy.

  1. Purpose and Scope

    We collect certain data to periodically improve this service and other related services we provide. By using this service, you consent to the collection, storage, and use of your data as described in this policy.

  2. Types of Data Collected

@samhavens
samhavens / Node_AWS_Linux.md
Last active April 8, 2017 21:44 — forked from philihp/Node_AWS_Linux.md
Install Node.js on Amazon Linux (EC2)

##Installing Node.js on Amazon Linux AMI

The following will guide you through the process of installing Node.js on an AWS EC2 instance running Amazon Linux AMI 2016.09 - Release Notes

For this process I'll be using a t2.micro EC2 instance running Amazon Linux AMI (ami-d41d58a7). Once the EC2 instance is up-and-running, connect to your server via ssh

@samhavens
samhavens / embeddableclip.html
Created March 3, 2016 21:38 — forked from skopp/embeddableclip.html
A simple way to embed gist into Blogger's dynamic view.
<!-- to do: make this parse -->
<div class="clipboardEmbedClip" data-clip-id="LQL1lDhsxPcZfc2h4vuk3E1MpI-5Xc_CPlqe" data-width="782" data-height="763" data-scale="disabled">
</div>
<script type="text/javascript">(function() {if (!window.CLIPBOARD || !window.CLIPBOARD.widgets) {var elem = document.createElement("script");elem.type = "text/javascript";elem.async = true;elem.src = "//clipboard.com/js/widgets.js";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(elem, s);}})();
</script>
@samhavens
samhavens / callbackParams.js
Last active March 3, 2016 21:35
Intro to Asynchronicity in JavaScript
/*
***Here is my attempt at explaining the default params in a standard callback in JavaScript***
When you see something like the following...
*/
storage.users.get(message.user, function(err, user) {
if (user && user.name) {
reply(Hello + ' ' + user.name + '!')
} else {
reply(Hello + '.')
@samhavens
samhavens / sitemapgenerator
Last active August 29, 2015 14:01
Sitemap Generator from db for sites OTF www.site.com/type/sub_type
<!--
This generates a sitemap from the database schema yourdb.
It assumes you have an updated copy of the database available locally.
It has options for setting the relative priority of type- and sub_type-specific pages.
It can generate a new robots.txt.
TO-DO: add "auto-submit to google" option (first need to submit manually once).
-->
<!doctype html>
<html lang="en">
<html>
<head>
<title>Merge Sort with Inversion Count Using PHP</title>
</head>
<body>
<form action="openfile.php" method="post">
Name of input file: <input type="text" name="name"><br>
<input type="submit">
</form>
a = []
#the following inputs the test file and puts it into array a when IntegerArray is the input
File.open("IntegerArray.txt").each_line do |line|
a << line.to_i
end
$inversion_count = 0
def merge_sort(array)
@samhavens
samhavens / timestamp_converter
Last active August 29, 2015 13:59
A manual Unix timestamp converter
<!DOCTYPE html>
<html>
<head>
<title>Date</title>
</head>
<body>
<h1>
<?php
//get time from server, call it $n
$n = $_SERVER['REQUEST_TIME_FLOAT'];