ATX Diversity Hackathon 2017

This past weekend I participated in the Austin Diversity Hackathon hosted by Women Who Code – ATX.  I pitched an app to make a nature journal for pre-literate children.   This idea came about because my son, Eli, is 4 years old and loves to go on nature walks and collects rocks, leaves, and flowers as we go on our walks.  I don’t like finding rocks in the laundry machine all the time 😂 and I don’t like that he disrupts nature for his collection, so an app that a child could use and didn’t require a cell phone or wifi connection.  I had one person join me, Gabby, and she was the designer for the app and I was the programmer.

The repo for this project can be found at https://github.com/StabbyMcDuck/nature_journal

I was able, in 1.5 days, to get the initial table view, adding something to your collection, add a camera, video, or add a photo from your photo library and also record an audio file (pre-literate kids can’t write either!) and play the audio file back.

We didn’t win any prizes, but I got some serious work done and I’m already planning on my next app!  I wasn’t planning on going to this, as I was convinced I wouldn’t win.  I didn’t win 🤣 but it turns out that wasn’t what I found to be the point of this weekend – it was about doing something I didn’t know I could do.

There’s a lot left to do but I’m excited what else I can do to make this app amazing for Eli to use.  I plan on putting it on the app store soon.  🎉

ElixirConf 2017 talk ✅

I did it!  I actually gave my first talk at a national conference.  I honestly thought I was going to melt into a puddle of embarrassment and nervousness but I retained my solid form, gave the talk, didn’t pass out, and was able to reasonably talk to people who asked me questions afterwards.  ✅✅✅

The folks at ElixirConf are way on the ball and have already published the videos from the entire conference.  The video from my talk is on Youtube and the slides from my talk (complete with my speaker’s notes) are available on SlideShare for your downloading or viewing.

I had a really great time meeting so many folks who really care.  The conference was well organized and I didn’t have any bad interactions with anybody.   Folks were kind, excited to talk about the language and about software in general, and I was so happy to be able to contribute to the Elixir community in my own small way.

Thanks to everybody who helped me get where I am today.  I love you! 💖

Graph Databases + Neo4j

I’m giving a talk tonight about graph databases at AustinRB to talk about one graph database, Neo4j.

This is also the first half of my talk for ElixirConf, so you can think of it as a sneak peek! 😎

 

Quick Fix to Bolt Sips

Bolt sips, a Neo4j driver for Elixir, works really well except I couldn’t get the stupid localhost port to get established. RAGE.

via GIPHY

So instead of the steps outlined in the README, I did the following (thanks Luke! 😘 )

iex(1)> {:ok, pid} = Bolt.Sips.start_link(Application.get_env(:bolt_sips, Bolt))
iex(2)> conn = Bolt.Sips.conn

And it worked like a charm!

ElixirConf 2017

I’ll be speaking at ElixirConf this year!  My talk is about using Neo4j in an Elixir project.  I’m super excited (and a lil bit nervous!) to be going from speaking at local meetups to national conferences.

 

Model-View-Controller

In modern web and mobile development there’s a concept of Model-View-Controller (MVC) which is simply a design pattern in which every instance belongs to one of three layers -> Model Layer, View Layer, or Controller Layer.  Layer is just a fancy term for objects that fulfill a role.

  • Model Layer
    • holds data
    • has no info about User Interface (UI)
    • called things like you would call them IRL
      • For Crapper Keeper I had models for:
        • Users
        • Containers
        • Items
  • View Layer
    • UI primarily
      • things users can see
    • Things they can interact with go here
      • buttons, text fields, etc.
    • Sends message to controller
  • Controller Layer
    • Management for the app
      • configure the views that the users can see and when they can see it
      • the directions for how the app should work/flow
    • Takes data from model objects that its views want information on
    • Updates model objects
    • Updates view with changes in model objects

Models do not interact directly with views – the controller layer does all of the talking between these layers, receiving and dispatching requests.

 

Drop/Create/Migrate Postgres Database On Heroku

I’m ALWAYS forgetting how to reset the postgres database on Heroku, because the typical rake db:drop/create/migrate won’t work on the Heroku command line. This is 99% for my own future reference, but to reset the database on Heroku:

  1.  heroku pg:reset
    •  it will ask you to type in your heroku url, follow the directions and do so!
  2.  heroku run rake db:migrate
    •  this may take a little while!

Easy breezy, I just always forget it!

Ruby’s Method Lookup

In many programming languages you are able to lookup methods without much trouble – just start at the receiver and work up the chain until you find the method you want.  However, in Ruby, you are able to mix in modules and singleton classes, so it gets weird fast.

There are just a few steps on how Ruby looks up methods:

  1.  Look within singleton class
    • A singleton method is a method that is defined on a instance vs. to a class where the method would be available on all instances
  2.  Look within modules that extend singleton classes
    • If you can’t find the method on the singleton class, look at modules that extend the singleton class
    • If there are multiple extend modules, the later modules are more important and take precedence
  3.  Look within methods prepended to the method and methods defined on a class
  4.  Look within modules that were mixed in when class was defined
  5.  Look up the ancestor chain
  6.  Start again checking method_missing