Skip to content

Instantly share code, notes, and snippets.

View rosiehoyem's full-sized avatar

Rosie Hoyem rosiehoyem

View GitHub Profile
@rosiehoyem
rosiehoyem / getting-started-with-airflow.md
Last active January 14, 2023 18:09
Getting Started With Airflow

Install Airflow

1. Install Airflow

Follow the installation instructions on the Airflow website.

Update Airflow Configurations

To configure Airflow to use Postgres rather than the default Sqlite3, go to airflow.cfg and update this configuration to LocalExecutor:

# The executor class that airflow should use. Choices include
@rosiehoyem
rosiehoyem / production-checklist.md
Last active March 8, 2017 16:08
Production Checklist
@rosiehoyem
rosiehoyem / min-viable-flask-app.md
Last active April 2, 2017 22:21
Minimally Viable Flask Application

This is a tutorial for a mini data science quiz app that we will deploy to Heroku. You'll find the completed code here.

This simple app is based on the gettting started tutorial from the framework's creators, Pocoo.

0. Install Flask

If you're an Anaconda user, run:

conda install flask

@rosiehoyem
rosiehoyem / checkout_controller.rb
Last active August 29, 2015 14:17
Tracking Checkouts
class CheckoutsController < ApplicationController
...
def create
@checkout = @item.checkouts.build(checkout_params)
respond_to do |format|
if @checkout.save
if @checkout.reservation == true
@checkout.create_activity :reservation, options = { owner: Person.find(@checkout.checked_out_by), recipient: @item, approved_by_id: @user.id }
else
@rosiehoyem
rosiehoyem / gemfile.rb
Created March 14, 2015 19:27
My preferred Ruby stack
source 'https://rubygems.org'
gem 'rails', '4.1.1'
gem 'pg'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'therubyracer', platforms: :ruby
gem 'devise'
@rosiehoyem
rosiehoyem / blog_remind.coffee
Created February 2, 2015 21:59
Blog Reminder Script for Hubot
# Description:
# Forgetful? Add reminders
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
@rosiehoyem
rosiehoyem / app_controllers_digitize_steps_controller.rb
Last active August 29, 2015 14:11
Forms, Complex Data Models and AJAX
# /app/controllers/digitize_steps_controller.rb
...
responds_to :js
...
def form
end
...
@rosiehoyem
rosiehoyem / digitize_step_model.rb
Last active August 29, 2015 14:11
Meta Programming: instance_variable_set() and instance_variable_get()
# /app/models/digitize_step
class DigitizeStep < ActiveRecord::Base
belongs_to :process_step
end
@rosiehoyem
rosiehoyem / app_model_person.rb
Last active August 29, 2015 14:11
Ruby Transactions
class Person < ActiveRecord::Base
...
def destroy_door_access
if self.door_accesses.first
self.door_accesses.first.destroy
else
true
end
@rosiehoyem
rosiehoyem / testing_with_rspec
Created November 11, 2014 02:19
Testing Best Practicies
#Testing Best Practices
##Unit Testing with Rspec
Rspec Core Syntax
Rspec Expectations
Rspec Matchers