Skip to content

Instantly share code, notes, and snippets.

View katherineimogene's full-sized avatar

Katie Hayden katherineimogene

View GitHub Profile
@katherineimogene
katherineimogene / Algorithmia-building-blocks.md
Last active November 26, 2016 06:30
Using the Algorithmia API as building blocks for applications

Building Blocks

Algorithmia API as building blocks for your application

The Algorithmia API has a well-defined protocol. Use the same pattern to call any algorithm, and the output will be in an easily handled format like a string or array. The consistency of inputs and outputs of the API enables developers to use many different algorithms as building blocks to construct dynamic applications.

Before we go through an example, please take a look at the docs. There are instructions about obtaining your API key and specifications for the protocol. Everything you need to know, really.

For our example, let's say I want to know what the first five articles on the popular page of GeekWire are about, and I want to know what people are tweeting about them.

There are algorithms in the Marketplace for that.

@katherineimogene
katherineimogene / oauth2-google.md
Last active August 29, 2015 13:57
implementing oauth2 with google

Git workflow starting with new feature

  1. git pull origin master
  2. git co -b FEATURE_BRANCH
  3. do work
  4. git co master checks out local master
  5. git pull origin merges most recent master into local master
  6. git co FEATURE_BRANCH
  7. git merge master merges local master into feature branch
  8. resolve any conflicts
  9. git push origin FEATURE_BRANCH
@katherineimogene
katherineimogene / add_git_remote.md
Last active August 29, 2015 13:57
Add remote to pull in Skeleton/Templates

Add a remote repository

To bring code into our project

  1. Make sure you're in the directory where the code should live
  2. Add remote git remote add REMOTE_NAME REPOSITORY_URI_FROM_GITHUB
  3. To see all remotes git remote -v
  4. Pull in remote code git pull REMOTE_NAME BRANCH_NAME
  5. Resolve merge conflicts (README,etc) and commit
@katherineimogene
katherineimogene / Push_to_Heroku.md
Last active August 29, 2015 13:57
Guide: pushing to Heroku (Sinatra. Some changes necessary for Rails)

HEROKU

  1. heroku create
  2. heroke apps:rename NEW APP NAME
  3. Checkout your branch locally git checkout <branch_name>
  4. Add Procfile to root of the application.
# Procfile
web: bundle exec rackup config.ru -p $PORT
  1. Add Heroku master as remote branch

How can I use let and context to DRY up my tests?

Let

Let blocks allow you to provide some input to the subject block that change in various contexts. You can simply provide an alternative 'let' block for a given value and not have to duplicate the setup code for the subject over again.

For the method defined by let, the initialization code only runs if the example calls it. let! will eager-load the variable. initializes it before it's ever used.

  # this:
  let(:foo) { Foo.new }
@katherineimogene
katherineimogene / 0.2.1-boggle_class_from_methods.rb
Last active January 1, 2016 03:09 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1 boggle class challenge
class BoggleBoard
# 1. Initialize
def initialize(dice_grid)
@dice_grid = dice_grid
end
# 2. create_word
def create_word(*coords)
coords.map { |coord| @dice_grid[coord.first][coord.last]}.join("")