Skip to content

Instantly share code, notes, and snippets.

View joelcahalan's full-sized avatar

Joel Cahalan joelcahalan

  • Environmental Working Group
  • Washington DC
View GitHub Profile
@joelcahalan
joelcahalan / elasticsearch.rb
Created February 27, 2024 18:17
Replacment for def plist and the options in old formula
service do
run [opt_bin/"elasticsearch"]
working_dir var
log_path var/"log/elasticsearch.log"
error_log_path var/"log/elasticsearch.log"
end
see https://github.com/brianmario/mysql2/issues/1250#issuecomment-1075672620
brew update --preinstall
brew install openssl@1.1
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
gem install mysql2 -v '0.5.2' -- --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include
@joelcahalan
joelcahalan / gist:204fe65800112f6a1f401a2064c887bd
Created November 6, 2019 16:18
notes stimulus controller
import { Controller } from "stimulus";
export default class extends Controller {
static targets = ["notes", "unreadCount"];
connect() {
this.getNewNotes();
if (this.data.has("refreshInterval")) {
this.startRefreshing();
}