Skip to content

Instantly share code, notes, and snippets.

View crcastle's full-sized avatar
:shipit:

Chris Castle crcastle

:shipit:
View GitHub Profile

Install Go using asdf for Visual Studio Code on macOS

I had a lot of issues trying to install Golang on macOS using asdf package manager to develop on Visual Studio Code.

So here's the steps needed to setup it properly:

Open Terminal and install asdf with this command:

You have to install Homebrew before running the installation command.

#!/bin/bash
brew_command=/usr/local/bin/brew
brew_cask_command="$brew_command cask"
echo '#!/bin/bash'
echo ''
echo 'trap ctrl_c INT'
echo 'function ctrl_c() {'
echo 'echo "** Trapped CTRL-C"'
@crcastle
crcastle / ESP8266 Code (RX node)
Last active December 15, 2022 23:36
Trying to use NRF24L01+ on ESP8266, using the ESP8266 as MCU (i.e. not an Arduino or ATmega328). See https://github.com/esp8266/Arduino for details on initial setup of ESP8266 as Arduino-compatible MCU. The serial output below does not show expected messages: a) the full output shows up all at once then stops dead and b) the values for _salt, vo…
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define DEVICE_ID 2
#define CHANNEL 1 //MAX 127
RF24 radio(15, 15); // Set up nRF24L01 radio on SPI bus plus pins 7 & 8
// Topology
const uint64_t pipes[2] = { 0xFFFFFFFFFFLL, 0xCCCCCCCCCCLL };
@crcastle
crcastle / ESP8266-nRF24L01.ino
Created September 23, 2015 06:38
Using an Adafruit Huzzah ESP8266 with nRF24L01+ as a (one-way) internet gateway for several nRF24L01+ sensor nodes
#include <SPI.h>
#include <RF24Network.h>
#include <RF24.h>
#include <ESP8266WiFi.h>
const char* ssid = "ssid";
const char* password = "password";
const char* host = "coolapp.herokuapp.com";
@crcastle
crcastle / ESP8266 Code (RX node)
Created July 13, 2015 01:14
Resolution of issue with ESP8266 described in https://gist.github.com/crcastle/93ebe3b42f3ab021639b (see comments for detailed changes)
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define DEVICE_ID 2
#define CHANNEL 1 //MAX 127
// SPI pin configuration figured out from here:
// http://d.av.id.au/blog/esp8266-hardware-spi-hspi-general-info-and-pinout/
RF24 radio(2, 15); // Set up nRF24L01 radio on SPI bus plus pins 2 for CE and 15 for CSN
#!/usr/bin/ruby
# Requirements:
# - rb-dayone and doing gems installed for the system Ruby.
# (Mine (OSX 10.10) are in /Library/Ruby/Gems/2.0.0/gems/)
#
# How to run:
# $./dayone-to-doing.rb 0A8BE4BB9F7E40B5A6F3F621797FC6F5.doentry
# The parameter passed to the script is the doentry file that was just created.
# The script will:
@crcastle
crcastle / kafka-from-cli.md
Last active August 26, 2021 13:02
Kafka CLI example using Apache Kafka on Heroku
@crcastle
crcastle / confluent.properties
Created August 11, 2016 18:13
Kafka Connect with SSL Trials and Tribulations
security.protocol=SSL
ssl.truststore.location=/app/.truststore.jks
ssl.truststore.password=test1234
ssl.keystore.location=/app/.keystore.jks
ssl.keystore.password=test1234
ssl.key.password=test1234
bootstrap.servers=ec2-52-1-245-163.compute-1.amazonaws.com:9096,ec2-52-22-254-93.compute-1.amazonaws.com:9096,ec2-52-207-158-223.compute-1.amazonaws.com:9096
rest.port=46369
# copied from Kafka Connect distribution etc/kafka/connect-standalone.properties example file
# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will
@crcastle
crcastle / brew-updates.1h.sh
Created December 9, 2020 17:11
My BitBar enabled plugins - heroku, homebrew, github, and googlecal
#!/bin/bash
# <bitbar.title>Homebrew Updates</bitbar.title>
# <bitbar.author>killercup</bitbar.author>
# <bitbar.author.github>killercup</bitbar.author.github>
# <bitbar.desc>List available updates from Homebrew (OS X)</bitbar.desc>
exit_with_error() {
echo "err | color=red";
exit 1;
}
@crcastle
crcastle / rtftomarkdown.rb
Created August 10, 2016 22:14 — forked from ttscoff/rtftomarkdown.rb
Convert RTF/DOC files to Markdown via Textutil
#!/usr/bin/ruby
=begin
Usage: rtftomarkdown.rb FILENAME.rtf
Uses textutil, available on Mac only (installed by default)
Outputs to STDOUT
Notes:
Links are replaced with Markdown references (duplicate links combined).