Skip to content

Instantly share code, notes, and snippets.

Chris Castle crcastle

Block or report user

Report or block crcastle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
crcastle / prompt_purewildcherry_setup.zsh
Created Jun 22, 2018
Heroku customized command prompt with ZSH and Prezto
View prompt_purewildcherry_setup.zsh
# Pure
# by Sindre Sorhus
# MIT License
# For my own and others sanity
# git:
# %b => current branch
# %a => current action (rebase/merge)
# prompt:
crcastle /
Created Feb 13, 2018
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
-----> 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 /
Last active Jan 10, 2018
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
####### 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 / server.js
Last active Jan 24, 2018
Simplest Node.js Web Server
View server.js
const http = require('http')
const PORT = 3000
const requestHandler = (request, response) => {
response.end('Hello World!')
const server = http.createServer(requestHandler)
server.listen(PORT, (err) => {
View gist:9b6512564c9660cbfac8420833253644
  ~/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 /
Last active May 5, 2017
Some Node/JavaScript One-Click Heroku Deploys
crcastle /
Last active Mar 21, 2017
Some Java One-Click Heroku Deploys
crcastle / yarn_lock.sql
Created Mar 15, 2017
Google BigQuery SQL query for yarn.lock
View yarn_lock.sql
COUNT(repo_name) AS count
path LIKE 'yarn.lock'
crcastle / get-kindle-highlights.rb
Created Jan 22, 2017
Extract Kindle highlights into CSV format for
View get-kindle-highlights.rb
require 'kindle_highlights'
kindle =
email_address: '',
password: '',
mechanize_options: { user_agent_alias: 'Mac Mozilla' }
puts 'quote_id,quote_link,quote_text,post_title,post_link,post_author,post_author_link,post_site_link,unix_time'
kindle.books.each do |asin, title|
crcastle /
Last active Jan 3, 2017
Heroku Fast Demo Create App and Deploy
mkdir my-app
cd my-app
echo "Hello World!" > index.php
git init
git add .
git commit -m 'Initial commit for new app'
heroku create
git push heroku master
heroku open
You can’t perform that action at this time.