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! ūüėé

 

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.

 

Learning AngularJS

I’ve been learning more front end development as I don’t feel that I actually know enough to call myself ‘full-stack’. ¬†I know HTML/CSS pretty solidly and vanilla Javascript, but the frameworks have always been vaguely mysterious. ¬†I am working though Code School¬†to learn Angular and lucky for me, it’s set up a lot like Ruby on Rails. ¬†Putting so much stuff in the HTML tags feels a lot like Bootstrap.

I’m also working on 100 days of code, but have already fallen off. ¬†Coding while sick is a dangerous thing to do, folks.

Chromebook OpenVPN

I recently got a new job and had the pleasure/torture of being assigned a Chromebook and needing to get it onto the VPN. This is easy on a Mac, which everybody else has, but since the ChromeOS is so lightweight, it was more challenging. I eventually got it to work though, so here are my directions!

If you don’t already, you’ll need some text editor (not Google Docs) and I had good luck with Caret¬†and you’ll need some sort of sftp system¬†and a shell. ¬†I also recommend using developer mode for the Chromebook, as it makes for a lot less hassle long term. ¬†You can also dual boot into linux, but I don’t do that as ChromeOS in developer mode has been enough for me to be pretty happy!

Network

First, have a read on Errietta’s blog¬†and get an idea on how this will work. ¬†I tried her directions and they weren’t entirely sufficient, but I got 90% there.
First go into your OpenVPN directory and build a key:
./build-key client1my

which will build a key and a certificate (.key and .crt) but they will be generated in the directory that the file vars specifies. I had to run:

openssl pkcs12 -export -in client1.crt -inkey client1.key -certfile ca.crt -name MyClient -out client.p12

Go into your openvpn/ccd directory and copy the most recent file . Don’t forget to increment both IPs in the file by 1 (so you don’t have conflicts later on!)

You should now have a client.p12 file.  Share this with the Chromebook in Google Docs.

 

On the Chromebook

Navigate to chrome://settings/certificates (in the browser) and in the Authorities tab, click ‘Import’ and select the ca.crt file (in the ‘shared with you’ section of Google Docs!) ¬†You will be asked if you want to trust the ca, click on ‘trust this certificate for identifying websites’ and leave the rest blank.

Now navigate to chrome://settings/certificates and click on “your certificates” and then “import and bind to device” (NOTE: NOT JUST IMPORT, IT MUST BE IMPORT AND BIND TO DEVICE) and select the .p12 file from earlier. ¬†You should see your (hardware-backed) by the certificate name.

ONC File

First, make your .onc file, as can be seen here:¬†https://github.com/syedaali/configs/blob/master/openvpn-sample.onc¬†and you will need to upload it. ¬†In a browser tab, open chrome://net-internals and along the left side of the page, click on “ChromeOS” then click on the “choose file” button in the line “Import ONC File”

DO NOT PANIC IF NOTHING HAPPENS!  (I panicked and it was unnecessary!)

After a few short moments, the name you gave your network name should appear in the OpenVPN/L2TP screen (click on the wifi icon near your profile icon in the lower right corner of the Chromebook screen, click on VPN, and the file with your name on it should appear there!)

Fill in your password and leave OTC and group name blank.

 

Congrats, you’re all done!

Crapper Keeper

Crapper Keeper is a consumer inventory system built with Ruby on Rails backend, Bootstrap frontend and and iOS app. Uses OmniAuth with Facebook login, Postgres database, deployed on Heroku.  Users login using Facebook, enter the location where they are keeping items to be tracked and can upload or take a picture of the item. Users can search for the item name or can browse through containers.

This is a work in progress, check out the site to see what step I’m on! ¬†Code can be viewed on Github.

screen-shot-2016-09-27-at-10-40-21-am

Add Constraints

Adding constraints to elements in your app helps your app look consistent between different devices that run iOS.  You can have a button that is centered in an iPhone 6 and is also centered in an iPad Pro.  You can also have that button be centered depending on if you are viewing in portrait vs. landscape mode.

Add Constraints

In your project, select the element to which you will add constraints.  You can select it in the view controller navigation on the left side of Xcode.  See it below, the button is highlighted.

Screen Shot 2016-09-06 at 12.06.00 PM

Next click on the bar graph button on the bottom right of the view board.  You can see a menu pops up.

Screen Shot 2016-09-06 at 12.06.12 PM

Then you can click both Horizontally and Vertically in Constraint buttons on the left, then click the bottom button that says “Add 2 constraints”

Screen Shot 2016-09-06 at 12.06.29 PM

Now your element is both vertically and horizontally aligned!  Pretty neat and pretty easy!

What Makes a Good App?

I’ve been brainstorming new app ideas and I’ve been coming up with a list of qualities that makes for a good app.

  • Thumb/finger friendly buttons
  • Doesn’t use up all my battery life
  • Doesn’t use up all of my data
  • Runs fast enough that I don’t give up and switch to something else
  • Does something that would be harder to do without the app —> MAKES LIFE EASIER

I feel like that last point is where we get hung up as app developers. ¬†It’s fun making apps! ¬†It’s fun adding functionality! ¬†But is it easier to do whatever it is we are doing on the app than it is on the website or using some other tool. ¬†That’s the real pickle we’re in.

Site Redesign

After some trouble with hosting issues, the website is back up!

I’ve been keeping busy with freelance projects, primarily fixing sites. In an interview recently, I was asked why I like programming. I responded with “I don’t always like programming!” and it’s true!! When I’m deep in the middle of trying to get a site to show the stupid preview image and there are 48 plugins that aren’t necessarily tested to work with the new WordPress update…I don’t like programming then.

But when I get the site working and running beautifully, I really love programming.