Skip to content

Instantly share code, notes, and snippets.

View distractdiverge's full-sized avatar

Alex (Allie) Lapinski distractdiverge

View GitHub Profile
@distractdiverge
distractdiverge / gorilla.py
Created June 19, 2023 22:19
Sample integration using openai to the gorilla specialized LLM instance.
# Import Chat completion template and set-up variables
import sys
import openai
import urllib.parse
openai.api_key = "EMPTY" # Key is ignored and does not matter
openai.api_base = "http://34.132.127.197:8000/v1" # This is valid, keep this value
# Report issues
def raise_issue(e, model, prompt):
@distractdiverge
distractdiverge / end.gcode
Last active November 23, 2021 02:20 — forked from wess/gist:c66382198d48238787718b9bb8e9f3d9
Start/End GCodes for BLTouch Ender 3
; Ender 3 Custom End G-code
M400 ; Wait for current moves to finish
M220 S100 ; Reset Speed factor override percentage to default (100%)
M221 S100 ; Reset Extrude factor override percentage to default (100%)
G91 ; Set coordinates to relative
G1 F2400 E-3 ; Retract filament 3mm at 40mm/s to prevent stringing
G0 F5000 Z20 ; Move Z Axis up 20mm to allow filament ooze freely
G90 ; Set coordinates to absolute
G0 X0 Y235 F5000 ; Move Heat Bed to the front for easy print removal
M84 ; Disable stepper motors
@distractdiverge
distractdiverge / bootstrap.yaml
Last active March 12, 2020 20:22
Cloudformation Script to create resources for Remote State Storage in Terraform
---
AWSTemplateFormatVersion: 2010-09-09
Description: Creates the required resources to use as the state backend for Terraform
Parameters:
AccountId:
Type: Number
Description: The AWS Account Number
BucketName:
Type: String
Description: The Bucket Name for the S3 bucket to store the state
@distractdiverge
distractdiverge / Makefile
Last active March 12, 2020 20:22
Terraform Makefile
########################################################################
# Variables #
########################################################################
PARAMS= # Dummy variables to pass commands to TF
PROJECT_DIR=$(shell pwd)
KUBE_CLUSTER_NAME=terraform-eks-demo
TERRAFORM_DIR=$(PROJECT_DIR)
BACKEND_CONF_PATH = $(TERRAFORM_DIR)/config/aws-personal-eks.conf
@distractdiverge
distractdiverge / Makefile
Last active March 27, 2020 16:59
Self-Documenting Makefile
# Colors -- https://www.linuxjournal.com/article/8603
BLACK = "\\033[30m"
RED = "\\033[31m"
GREEN = "\\033[32m"
YELLOW = "\\033[33m"
BLUE = "\\033[34m"
MAGENTA = "\\033[35m"
CYAN = "\\033[36m"
WHITE = "\\033[37m"
END = "\\033[0m"
@distractdiverge
distractdiverge / main.tf
Last active March 3, 2020 23:11
Terraform Params and Iteration
provider "aws" {
region = "us-east-1"
version = "~> 2.0"
}
data "aws_region" "current" {}
data "aws_caller_identity" "caller" {}
locals {
module_name = "api_gateway"
@distractdiverge
distractdiverge / index.js
Created September 26, 2017 01:56
Example jsforce Retry Expired Token
const Promise = require('bluebird');
const retry = require('bluebird-retry');
class AuthError extends Error {
constructor(message) {
super(message);
}
}
let count = 0;
@distractdiverge
distractdiverge / test
Created December 11, 2014 17:41
Object to QueryString
var _objectToQueryString = function(object) {
if(!object) {
return '';
}
if(_.isEmpty(object)) {
return '';
}
var queryString = '?';
@distractdiverge
distractdiverge / DefaultEmailProvider.cs
Last active August 29, 2015 14:07
ASP.NET MVC Razor Template Emails
using System;
using System.Net.Mail;
namespace Client.Project.Repository.Services
{
public class DefaultEmailProvider : IEmailProvider
{
private const int DEFAULT_PORT = 25;
private readonly int _smptServerPort;
@distractdiverge
distractdiverge / backup.sh
Created September 30, 2014 17:40
MongoDB Backup Example (run by crontab)
mongodump —out /home/node/data-backups/`date “+%Y-%m-%d-TIME-%H-%M-%S”`