Monday, April 4, 2016

Week 12 - Wikipedia App - devise, haml, simple_form, bootstrap-sass



Today I finished Mackenzie Child's 12 Apps In 12 Weeks Challenge.  Below is the wikipedia app. You can create articles and put them into categories, which can be used to filter the articles.  I used simple_format again, which allows users to input html into the form for each article.

Show View


I saved this app for last only because I wanted to do the other 3 after this one first.  They were very different from the other apps.

Features to add:
1. Table of Contents
2. Embed pictures
3. Rendering an iframe so youtube links become embedded videos right on the view page.
4. Rich text formatting
5. Ability to upload text files

Technologies used: devisehamlsimple_formbootstrap-sass

So this concludes my 12 in 12 challenge.  I will make a post about my experience building all 12 apps in my next blog.

Kenyacode

Friday, April 1, 2016

Week 11 - Dribble App - carrierwave, acts_as_votable, fog-aws, mini_magick, devise, simple_form, haml




Today I finished work on the Dribble App.  It is a cool way to display artwork and anything visually stunning. (i.e. Wonder Woman)  Since it supports pictures and gifs, I had to again use paperclip, I mean carrierwave.  Paperclip didn't work for me for the 3rd time.  It works well locally but integration with S3 did not compute.

I learned some cool new things in this app.  Like in the picture below, on the right I can display a random post.  It was done with one simple line of code.






While working on a bug for a few hours I ran into a solution that wasn't covered by Mackenzie Child. When you push this app to heroku, you will not have a database.  There is code in post/show.html.haml that is looking to display a post that will break because there aren't any posts.

The code looks for a post that does not have the same user_id as the post that is displaying, puts it into a collection and gets a random one to display.  So I just thought, well it should only show a post if there is more than 1 post.


So in line 1 I added an if statement. if Post.count > 1 display the random post else display the sentence You have the first post.


It is not a big deal, since I can populate the database and it takes just one to keep the app from breaking, but in my book its a bug that had to be fixed.

Functionality I would like to add:
1. Better picture formatting so each pic on index page is the same size
2. Search function.
3. Rich text formatting
4. Social media shareability
5. Make pictures 30%-50% bigger. Move random box view down to lower right corner.
6. Add a large version of the picture to have as a background image for each post.
7. Tie dislike button to comments, so a user has to leave a comment if disliking a post.

Tune in next week, for the final app.

Kenyacode

Wednesday, March 30, 2016

Week 10 - Forum App - devise, haml, simple_form, bootstrap-sass, heroku, normalize.css



Hello and welcome to another exciting episode of 12 apps in 12 weeks.  I'm your host Kenyacode and this is week 10.  Yesterday I made a forum site.  If you have been reading this blog since week one or have been doing the challenge yourself, you should have see that many of these apps share much of their functionality.  The forum app has posts and comments, just like the blog app, the raddit app, and the movie review app.  Websites can very different in content but be very similar in functionality.

Again I made a landing page that tells users and visitors what the site is about.  I plan to add a landing page to all 12 websites.  It just makes sense.

Here is the page you see when you log in.


Here is the show page for each Forum post.


What I had to figure out in this app was how to use normalize with bootstrap.  First I just imported bootstrap and bootstrap sprockets into the application.css.scss file at the bottom of the normalize imports.  Well that changed fonts and sizes for the rest of my page.  After 30 min I realized I needed to have the bootstrap on top of the normalize so normalize could override bootstrap.

Now it works great.

Features I would like to add:
1. Get avatars for users
2. Give users chat functionality.
3. List users currently online
4. To have this be part of my episodic app that i'm building. Hence why I named it episodic-forum.
5. Linking the tv show to its corresponding page on the forum.
6. This app would be good to incorporate AJAX.

Tune in next week, same app time same app url,

Kenyacode

Technologies used: devise, haml, simple_form, bootstrap-sass, heroku, normalize.css
Github page: https://github.com/kenyacode/forum

Friday, March 25, 2016

Week 9 - Notebook App - Normalize.css, font awesome, haml, simple_form, devise

Yesterday I finished my 9th App in Mackenzie Child's 12 apps in 12 weeks.  I changed the order a bit and did the 11th app on the 9th week.  I saw the design elements and couldn't wait to start it.  I was looking forward to working more on styling so I jumped right in.

This app is quite different from the others.  There is a different root page for users and for visitors. Also you can only see the notes that you have created.  Your notes are not in anyway visible to other users.  Okay here is what it looks like if you are a visitor.

Click Here to got to the website

You get this great splash page with marketing info.  I have placeholders.  Can you guess what the theme is for the 3 columns on the bottom image?

If you are signed in, this is what you see.  Each note or scribble in my case, is represented visually as a card.


The design was really interesting.  I love getting new tools and tips so here's one for you.  The css I downloaded from Normalize.  Normalize makes browsers render all elements more consistently and in line with modern standards.  Go the page and click download then simply copy and paste into a new file in your app called app/stylesheets/normalize.css.scss.  There were some other css pages Mackenzie included on his github page and they were imported into application.css.scss
     @import 'normalize.css';
     @import 'global.css.scss';
     @import 'notes.css.scss';
     @import 'welcome.css.scss';

Another fun feature is the ability to include html in the notes/scribbles.  There is a method that you add to the show page that allows html.  It is called simple_format and it is provided by simple_form.


I put html code into the edit page and got a beautiful formatted notebook entry.

If you didn't know, when you allow html to be added into a form you leave your application open to hacks.  What happens is users are able to put javascript into the form that the server can interpret as your code.  Don't worry, thanks to some Wheaties eating developers at Ruby, we are protected from that type of attack.

Check out my "Marvel's Civil War Reading Guide" complete with links and pictures.


So that's it for week 9.  I am truly enjoying this process.  I'm getting better and faster at writing code, having a list of useful gems, and deploying to heroku.  Until next week.

Features I would like to add:
1. Instructions on how to format pics and text.
2. Group notebook together into a collection
3. Rich text formatting
4. Suggestions for users on subjects to write about.
5. Email notebooks
6. Social media shareability

Kenyacode

Technologies used: font awesomenormalize.css, hamlsimple_formpumapostgreSQL,
Github Page: https://github.com/kenyacode/notebook

Wednesday, March 23, 2016

Week 8 - Workout Log - Haml, simple_form, bootstrap-sass, puma, postgreSQL

Click here to go to website

Yesterday I finished the 8 app in Mackenzie Childs 12 apps in 12 weeks challenge.  The workout log has shown me that I have learned a lot and that I am much faster at programming than I was 8 weeks ago.

Last week I went to Carbon Five's Hack Night, a meet-up in Santa Monica. Michael Wynholds was speaking on date-time in code.  I had no idea that time had so many elements to it.  Is it the current time? A time ago? Do you want the time from the timezone where the user is or the server or the company? That talk came in handy when building this app as it allowed me to search for different ways to interpret date time than was shown in Mackenzie's tutorial.

This is a simple_form for a workout.  Line 2 is the input field for date.  The date used in the tutorial was formatted 2014-10-26 11:47:00 UTC. (see green image below) No one reads date time like that so I changed not only the displayed date time, but the drop down menu to input it as well. (see blue image below)






One look at his design and I knew I had to brighten the colors and add forms divs to make it look nice and neat.  I put a table in the first form with the workout info, then made a second form with the exercise info, then a third form with the form partial.






If you are wondering how I did it, I found a great blog by Akshay Mohite that had all the date-times in ruby displayed. https://hackhands.com/format-datetime-ruby/

Features I would love to add:
1. Add users
2. Drop down list of exercises, based on Body Section.
3. Social media shareability
4. Search Functionality
5. Edit and update each exercise

Until next time, Kwaheri (see you later)

Kenyacode

Technologies used: Hamlsimple_formbootstrap-sasspumapostgreSQL
Github Page: https://github.com/kenyacode/workout

Friday, March 11, 2016

Week 7 - Jobs Board App - Bootstrap-sass, Simple Form, Haml

Click here to visit page

Yesterday I made the 7th app in Mackenzie Child's 12 app in 12 weeks challenge.  These apps generally take a week to make, maybe a few days but I was able to make this app in one day.

I learned about the f.collection_select method that allows for the form to filter from an attribute on the job model.  We made a category model, but inputed them manually into the database using the console, so that they could not be adjusted by a user.

I realized I had to do add the categories to Heroku after uploading the app.  I like the styling too.  It looks "pretty" as my teachers used to tell me.

Features I would like to add:
1. Search functionality
2. Add fields for location and date inputed.
3. Categories
4. Search by company, city, category.
5. Add users
6. Add Employer users.
Kenyacode

Wednesday, March 9, 2016

Week 6 - Todo App - Postgresql, Puma Server, Heroku

Click here to open in a new window
Today I started and finished this todo app in about 3.5 hrs.  A todo app is the first app I ever coded. The cool styling is all just Sass, so basic css.  I used a google font called "Lato" and "font-awesome" that allows you to use hundreds of icons.

You just add the cdn to your application.html.erb as in line 9.  I love the slick, simplistic look of the app.  I played around with the colors and I'm really happy with it.

Features I would like to add:
1. Users
2. Ability to uncheck a todo item.
3. Search funtionality
4. Edit each item.
5. Add a splash page.
6. Add due date
7. Add reminder
8. Add categories by color.
9. Add labels
10. Filter by labels.

Kenyacode