Skip to content

Instantly share code, notes, and snippets.

Fully caffeinated for your safety

brian piercy bjpcjp

Fully caffeinated for your safety
View GitHub Profile
bjpcjp / denominator-snippet.rb
Created September 12, 2012 01:24 — forked from rweald/denominator-snippet.rb
Code Snippets for Simple Linear Regression Using Ruby Blog Post
View denominator-snippet.rb
denominator = @xs.reduce(0) do |sum, x|
sum + ((x - x_mean) ** 2)
View nodejs setup on Dreamhost VPS
1) Make a download dir to store the node source and download it.
mkdir downloads
cd downloads
git clone
Find the latest version
2) List all of the tags in the repository, and check out the most recent.
git tag
git checkout v0.9.9
import scrapy
class StackOverflowSpider(scrapy.Spider):
name = 'stackoverflow'
start_urls = ['']
def parse(self, response):
for href in response.css('.question-summary h3 a::attr(href)'):
View multithreaded.stitchfix.com_blog_20160113_market-watch
# source:
# from terminal command line:
sudo apt-get install libcurl4-openssl-dev
# from R command line:
# install CausalImpact package:
bjpcjp / main.r
Created February 8, 2016 02:46
Build your own neural network classifier in R (source:
View main.r
# How to build your own NN classifier in r
# source:
# reference:
# project:
# 1) build simple NN with 2 fully-connected layers
# 2) use NN to classify a dataset of 4-class 2D images & visualize decision boundary.
# 3) train NN with MNIST dataset
# ref: stanford CS23 source:
bjpcjp /
Created February 8, 2018 22:57 — forked from theriley106/
Scraping Valid Addresses from all US ZipCodes
import sys
import requests
import bs4
import zipcode
import threading
import re
import json
import time
bjpcjp /
Created February 20, 2019 02:10
$python -- launches basic example of Dash web app framework. View results on localhost port# 8050.
import dash
import dash_core_components as dcc
import dash_html_components as html
external_stylesheets = ['']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.layout = html.Div(children=[
html.H1(children='Hello Dash'),

The Art of Profitability

Original notes by James Clear

  • Do the math yourself. Too many people take numbers from unreliable sources.

  • There are 4 levels of learning: Awareness, Awkwardness, Application, Assimilation

  • Customer-Solution Profit: Know your customers incredibly well and create a solution specifically for them.

bjpcjp / gist:6c44091abd0e8e7b35b30cb0d773709a
Created April 14, 2020 18:06
$vagrant plugin install vagrant-share error
View gist:6c44091abd0e8e7b35b30cb0d773709a
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
conflicting dependencies fog-core (~> 1.43.0) and fog-core (= 1.45.0)
Activated fog-core-1.45.0
which does not match conflicting dependency (~> 1.43.0)
Conflicting dependency chains:
bjpcjp / gist:c3bb322015e80a11a98463ac5025408a
Created May 15, 2020 15:09
$rails (6.0.3) test issue - unknown root cause
View gist:c3bb322015e80a11a98463ac5025408a
31: from -e:1:in `<main>'
30: from /home/<myname>/.rbenv/versions/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:72:in `require'
29: from /home/<myname>/.rbenv/versions/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:72:in `require'
28: from /home/<myname>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
27: from /home/<myname>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
26: from /home/<myname>/projects/ideas/factory-inabox/v20200501/bin/rails:9:in `<top (required)>'
25: from /home/<myname>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
24: from /home/<myname>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
23: from /home/<myname>/.rbenv/versions/2.5.1/lib/ru