Skip to content

Instantly share code, notes, and snippets.

@jakeceballos
jakeceballos / init.el
Created March 23, 2021 14:14
Emacs init
;; (require 'package)
;; (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; straight package manager
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
@jakeceballos
jakeceballos / worker-pool.go
Created June 29, 2020 21:22
Creating a worker pool
// Copied from a reddit post written by /u/jerf (Thanks Jerf)
// https://www.reddit.com/r/golang/comments/947jul/best_practises_for_pool_of_go_routines/
package main
import (
"fmt"
"sync"
"time"
)
@jakeceballos
jakeceballos / keybase.md
Last active September 26, 2019 16:54
keybase

Keybase proof

I hereby claim:

  • I am jakeceballos on github.
  • I am jakeceballos (https://keybase.io/jakeceballos) on keybase.
  • I have a public key ASD5vjYniNoH9bVDgT-TGIaWPvRhQFktUsVPV6XSsn8-IAo

To claim this, I am signing this object:

@jakeceballos
jakeceballos / http-request-get.js
Created April 19, 2018 17:55
Mirth Connect - GET request
var url = new java.net.URL('https://api.athenahealth.com/v1/' + practiceId + '/patients?departmentid=' + departmentId + '&limit=' + limit + '&offset=' + offset + '&status=a');
var conn = url.openConnection();
conn.setRequestMethod('GET');
conn.setRequestProperty('Authorization', 'Bearer ' + globalMap.get('Accesstoken'));
var inputStream = conn.getInputStream();
var streamReader = new java.io.InputStreamReader(inputStream);
var respStream = new java.io.BufferedReader(streamReader);
var buffer = new java.lang.StringBuffer();
@jakeceballos
jakeceballos / http-request-post.js
Last active February 25, 2022 13:46
Mirth Connect - HTTP Request
var body = {}
var endpoint = 'https://localhost/';
var method = 'POST';
// Create connection
var url = new java.net.URL(endpoint);
var conn = url.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setRequestMethod(method);
@jakeceballos
jakeceballos / sqs-reader.js
Last active March 18, 2018 21:29
Mirth Connect - JS reader for SQS
/*
Prequisites:
* Mirth is running on instance with IAM Role
* IAM Role has permissions to SQS
*/
var queueURL = 'https://sqs.us-east-1.amazonaws.com/776306751262/wiz_inbound_json_dev.fifo';
var request = com.amazonaws.services.sqs.model.ReceiveMessageRequest()
.withQueueUrl(queueURL)
.withMaxNumberOfMessages(10)