Skip to content

Instantly share code, notes, and snippets.

Avatar

Blaine Booher booherbg

View GitHub Profile
@booherbg
booherbg / files.md
Last active Jun 17, 2020
EDA HTML/CSS Workshop Code
View files.md

index.html:

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>Blaine's World</title>
    <link rel="stylesheet" href="./style.css">
  </head>
  <body>
View arrow-functions.md

Arrow Function Intro

function name(me) {
  console.log('my name is', me);
}

const name = function(me) {
  console.log('my name is', me);
}
@booherbg
booherbg / for-loops.md
Last active Apr 22, 2020
Simple For Loops
View for-loops.md

Week 3 Stretch Goal Tips

In general there are two types of problems to solve:

  1. "Calculate some value based on all the numbers in the array"
  2. "Find a number in the array and stop once you've found it"

In pretty much all cases, all you need to do is have a way of looping through the array of numbers, keeping track of what you have done so far, and reporting the result at the end.

@booherbg
booherbg / gist:f812c9145d157d8945b2
Last active Apr 20, 2020
Cross compiling a simple go server for windows
View gist:f812c9145d157d8945b2

How to build Golang windows/arm static binaries from linux

Alternate title: Cross compiling Windows/Darwin/Linux amd64/386/arm all from linux

After fumbling around trying to figure out the go toolchain and cross compilation configuration, I ran across the wiki page on Go's homepage. It's super helpful, and worked out of the box. I'm including the necessary scripts here in case they get changed or lost, and we can help Google find it (since it's the first real source I've found that "Just Worked"). http://code.google.com/p/go-wiki/wiki/WindowsCrossCompiling

@booherbg
booherbg / migration.md
Last active Dec 7, 2018
Migrating from Elixir to SQLAlchemy declarative
View migration.md

I have a project that's a few years old, but needs some maintenance. Since I last worked on the project, two major things have happened. First, Elixir -- a declarative layer on top of SQLAlchemy -- has not been maintained. Secondly, SQLAlchemy now has its own declarative layer.

Rather than continue using Elixir, I decided to migrate my data models to use the new SQLAlchemy declarative layer, which interestingly enough appear to be relatively compatible with Elixir's philosophy.

The first thing I did was do a direct mapping in my model columns and update the import statements.

# from Elixir import Entity, Field, DateTime, Unicode, Integer, Boolean, setup_all, create_all, session, metadata
from sqlalchemy import Column, DateTime, String, Integer, ForeignKey, Boolean
from sqlalchemy.ext.declarative import declarative_base
@booherbg
booherbg / scifi-notes.md
Last active Apr 17, 2018
Notes on SciFi
View scifi-notes.md

This is just a general repository for me to keep track of books that I've read over the years.

2018

  • The Dosadi Experiment (1977), Frank Herbert
  • Snow Crash (1992), Neil Stephenson; This was a doozie. Excellent read.

2017

  • Devil in the White City (2003), Erik Larson
View Project Crows.md

Jun 25 2017

Interested in becoming friendly with local crows after reading stories and first hand accounts. Obtained peanuts. Later, found grackles, but not crows. They're smaller and travel in larger flocks. Were not very interested in peanuts. They have irridescent blue heads. Curious if the small blue glass left in my garden is from the crows?

Squirrels like peanuts too. I threw a peanut towards an squirrel and it bounced off him. It did not phase him. He ate the peanut.

Jun 27 2017

@booherbg
booherbg / gist:cc09bb8bc66fae56f60e
Last active Jun 27, 2017
Getting started with Tensor Flow (Installation)
View gist:cc09bb8bc66fae56f60e
View gist:d3e71651534aeedbbaf680af44d1f9b3

Notes on upgrading to Elasticsearch 5.0.1 from 2.4

First get the latest ES (2.4):

# apt-get update
# apt-get install elasticsearch

After update, had to reinstall license and marvel
# bin/plugin remove license
@booherbg
booherbg / rails-apartment-notes.md
Last active Aug 29, 2015
Adding apartment to our api project
View rails-apartment-notes.md
  1. add apartment to gemfile
  2. run initializer to generate config/apartment.rb
  3. Create our Event model (which maps to schemas)
  4. before_validate: create self.schema that uses .parameterize.underscore from self.name on event model
  5. after_create: create new apartment tenant on the event model
  6. Set up the config to ignore a few of our models that are public
  7. hard code the config to select a single event schema, for now
  8. migrate over all the data: