Skip to content

Instantly share code, notes, and snippets.

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.

@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 / prompt_purewildcherry_setup.zsh
Created June 22, 2018 17:58
Heroku customized command prompt with ZSH and Prezto
# Pure
# by Sindre Sorhus
# https://github.com/sindresorhus/pure
# MIT License
# For my own and others sanity
# git:
# %b => current branch
# %a => current action (rebase/merge)
# prompt:
@crcastle
crcastle / volition-build-log-fail.sh
Created February 13, 2018 20:08
Volition build failing on Heroku
! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
Detected buildpacks: Ruby,Node.js
See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.4.0
-----> Installing dependencies using bundler 1.15.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Your Gemfile lists the gem premailer-rails (>= 0) more than once.
You should probably keep only one of them.
@crcastle
crcastle / commands.sh
Last active January 10, 2018 19:54
Heroku: Scale from 0 to 100 servers in 5 minutes
# Prep
# Do this in a team, not personal app, because we don't want to use Free/Hobby
export HEROKU_ORGANIZATION=demo-org
####### Start Demo Here
# I'm going to deploy a simple app to Heroku
# Add a new "feature"
# Scale it up to 100 servers (cause our company got mentioned on Techcrunch!)
# Then scale it down to 20 (to save $$$ since the load has gone down)
# And I'm going to do all this in less than 5 minutes (might need to be 7 or 10 min)
@crcastle
crcastle / server.js
Last active January 24, 2018 21:23
Simplest Node.js Web Server
const http = require('http')
const PORT = 3000
const requestHandler = (request, response) => {
response.end('Hello World!')
}
const server = http.createServer(requestHandler)
server.listen(PORT, (err) => {
@crcastle
crcastle / gist:9b6512564c9660cbfac8420833253644
Created December 8, 2017 20:31
kafka-streams-test word count
  ~/src/kafka-streams-on-heroku  master 🌷  59s
👉 h kafka:topics:write tombigbee-17823.textlines "the quick brown fox jumps over the lazy dog" -a kafka-streams-test
  ~/src/kafka-streams-on-heroku  master 🌷 
👉 heroku pg:psql -c 'select * from windowed_counts' HEROKU_POSTGRESQL_URL -a kafka-streams-test
--> Connecting to postgresql-vertical-36453
┌────┬───────────────┬───────┬───────┐
│ id │ time_window │ word │ count │
├────┼───────────────┼───────┼───────┤
│ 21 │ 1512765050000 │ brown │ 1 │
@crcastle
crcastle / jsconf-eu-demos.md
Last active May 5, 2017 14:45
Some Node/JavaScript One-Click Heroku Deploys
@crcastle
crcastle / devoxx-demos.md
Last active March 21, 2017 04:51
Some Java One-Click Heroku Deploys
@crcastle
crcastle / yarn_lock.sql
Created March 15, 2017 20:14
Google BigQuery SQL query for yarn.lock
SELECT
repo_name,
COUNT(repo_name) AS count
FROM
[bigquery-public-data:github_repos.files]
WHERE
path LIKE 'yarn.lock'
GROUP BY
Repo_name