Skip to content

Instantly share code, notes, and snippets.

Create s3 bucket

  • bucket needs to be in the same region as lambda function

Create a deployment package

This is the code that makes up your lambda function. We zip it up and can easily deploy it using the aws lambda cli.

  • write lambda code and zip it
  • don't zip the container folder, but do zip all the require folders and files inside of it

Create an execution role

Role is require to give lambda the permissions it needs.

Contributing to Figaro

  • Why: I use Figaro on every rails project to hide environment variables. If I can help make it better, I should.

* What: There is a bug where running `bundle exec figaro install` will append an ignore line in the .gitignore even if that line already exists. Seems reasonable. laserlemon/figaro#259
* I need: To dig into Figaro to figure out where that line is being added and see what changes need to be made. The first step will be to reproduce the bug.
* When I'm Done: There's not much conversation around the topic, but if the bug is fixed, I don't see why it wouldn't be merged.

Contributing to Shoulda-Matchers

Register an Application to use OAuth with Census

Census uses Devise and Doorkeeper to manage authentication.

Gems

Currently, there are 2 gems to help you set up OAuth, one for staging and one for production. Soon, we will add a configuation option so you don't need to change your gemfile before pushing to production.

Common Issues

  • HTTPS
    • Census only allows authentication from a secure connection. This won't be a problem on a Heroku server, but it's a bit of a headache on localhost. In order to test OAuth locally, you need to create an ssl certificate and run a local server "securly." Luckily, Nick Martinez wrote a great tutorial to make this work in the "Important Stuff" section of the oauth staging gem.
@JStans12
JStans12 / roles.md
Last active February 7, 2017 00:42

The lifecycle of user roles in Census

  • When an admin sends an invitation, they can select role from ["admin", "mentor", "student"].

  • If they select student, the new user will be given a role of either "enrolled", "active student" or "graduated" depending on the status of the cohort.

  • This makes 4 different roles that could be assigned to a new user.

  • There are 3 other roles which can be assigned later by an admin: ["exited", "removed", "graduated"]

install figaro:

gem 'figaro'

generate secret key:

rake secret

Form:

<div class="form-group">
  <%= label_tag :content, "Comment", class: "control-label col-md-4 required-field" %>
  <%= text_area_tag :content, "", id: "content", class: "input-md textinput textInput form-control" %>
  <input type="hidden" id="user_id" value=<%= "#{current_user.id}" %>>
  <input type="hidden" id="upload_id" value=<%= "#{@upload.id}" %>>
</div>
<div class="form-group">

cd to new directory and:

npm init

setup express:

npm install express --save

Joey Stansfield - M2 Portfolio

Areas of Emphasis

  • Learn the tools required to actually build websites
  • Become comfortable with SQL and databases
  • Get better at CSS and HTML
  • Start hardware posse
  • Write some blog posts
@JStans12
JStans12 / gist:86963b733db3060ed276f35447615253
Last active January 6, 2017 03:17
Rails_The_Way_I_Like_it

Generate a new project without the included testing and with a postgres database:

rails new MyApp -T --database=postgresql

Add rspec, capybara, factory_girl, launchy and database cleaner to gemfile:

group :development, :test do
  gem 'rspec-rails'
  gem 'capybara'