Skip to content

Instantly share code, notes, and snippets.

View holtbp's full-sized avatar
💻
We're hiring!

Brett Holt holtbp

💻
We're hiring!
View GitHub Profile
@holtbp
holtbp / rebase.sh
Created July 20, 2021 21:12
Quick helper for rebasing branch on latest master
#!/bin/bash
git checkout master && git fetch && git rebase origin/master
git checkout - && git rebase master
@holtbp
holtbp / scatterplot.rb
Created June 15, 2020 22:14
ASCII scatterplot from coordinates
coords = [
Coordinate.new(x=0.0, y=1.8),
Coordinate.new(x=1.5, y=2.2),
Coordinate.new(x=2.8, y=3.5),
Coordinate.new(x=5.0, y=4.2),
Coordinate.new(x=2.0, y=4.2),
]
class Coordinate
attr_reader :x, :y
@holtbp
holtbp / RiakSearchIntro.md
Last active May 18, 2016 23:18
Intro to Using Riak Search 2.0

Intro

This guide assumes you have Riak KV installed and running on port 8087. This guide walks through enabling Riak Search, enabling bucket-types, creating indices, inserting data, and searching data.

Enable Riak Search

To enable Riak Search, which uses Solr, you will need to install Java.

To install Java:

@holtbp
holtbp / .README.md
Last active September 7, 2017 19:24
Setup Ejabberd on Amazon EC2, CentOS 7

Introduction

This guide will walk through installing and configuring Ejabberd on CentOS 7 to use Riak KV, Redis, and MySQL.

Steps

I have provided an example ejabberd.yml to help.

@holtbp
holtbp / ejabberd.yml
Last active May 11, 2016 22:48
Development Ejabberd Configuration
###
###' ejabberd configuration file
###
###
### The parameters used in this configuration file are explained in more detail
### in the ejabberd Installation and Operation Guide.
### Please consult the Guide in case of doubts, it is included with
### your copy of ejabberd, and is also available online at
### http://www.process-one.net/en/ejabberd/docs/
@holtbp
holtbp / setup.md
Last active June 27, 2018 06:04
Ejabberd + Riak on Mac OS X

Install ejabberd

Started out by following the instructions here for installing ejabberd on my Mac.

Configure and make:

## Enable flags ensure modules are included to support Riak and Redis
./configure --enable-riak --enable-redis --prefix=$HOME/my-ejabberd
./rebar get-deps
./rebar compile
@holtbp
holtbp / BuildingPhoenixAPI.md
Last active June 26, 2023 18:01
Build and test Phoenix JSON API

Build and test a blazing fast JSON API with Phoenix, an Elixir framework

Original Post

Note: This guide was written for Phoenix 1.1.4. Parts of it may no longer work if you are using a newer version.

Let’s build a JSON API that serves a list of contacts. We’ll be writing it using Elixir (version 1.2.5) and Phoenix (version 1.1.4). Phoenix is a framework written in Elixir that aims to make writing fast, low latency web applications as enjoyable as possible.

Source Code: The source code after finishing this guide can be found here.

@holtbp
holtbp / Installation.md
Last active January 28, 2017 08:04
Getting Started with Elixir & Phoenix

Install

This install guide was written for Mac OS X, and Homebrew is required.

If you do not have Homebrew installed, you will find instructions here.

If you do have Homebrew installed, you will want to update it, just in case:

$ brew update
@holtbp
holtbp / .githelpers
Last active September 27, 2016 20:50
Git Helpers
#!/bin/bash
# Original by Gary Bernhardt:
#
# https://raw.github.com/garybernhardt/dotfiles/master/.githelpers
#
# Log output:
#
# 51c333e 2012-07-12 Gary Bernhardt add vim-eunuch
#
@holtbp
holtbp / turntableExperiment.js
Created April 2, 2012 20:56
Turntable (In Progress) - Attempt to make a closure without using the TTFM API
ttfm = {
awesome: null,
lame: null,
setButtons: function() {
var awesome, lame;
$('div.roomView > div > a').each(function() {
if ($(this).css('top') === '555px') {
if ($(this).css('left') === '370px') {
this.awesome = $(this);
} else {