I left my career as an educator/counselor to learn how to code. Not sure where this will take me, but this is my journey. Hello, World!
Don't wanna be here? Send us removal request.
Text
Debugging Rails Like a Pro
binding.pry, two words that have the ability to freeze your program in time and in IRB, gives you a more powerful way to debug. Once you have the gem installed, you can simply put the binding.pry command anywhere in your application (usually before the line of code that is breaking your app). In IRB, you will see the pry session along with the lines of code before and after it. In this session, you can do things like check to see if your variables are accurate and you can easily test out methods.
Here are some useful Binding Pry Commands:
whereami - reprints where you are in the pry session
ls - lists all the variables, methods, modules available in the current scope
wtf - will print the most recent error stack trace (it identifies the error, from the most specific context to the most general context)
exit - binding.pry session can be used inside a loop to check each iteration for errors. Typing 'exit' while inside that current pry session will take you out of the session and trigger again.
Read more about Pry here: http://pryrepl.org/
1 note
·
View note
Text
SVG 101
Scalable Vector Graphics, can be used in your web apps pretty easily. Here are some tips to get you started.
1. Design something in Adobe Illustrator. (Keep in mind that canvas matters in SVG - crop the artboard against the edge of your design)
2. Go to File and Save As: SVG(svg)
3. If successful, you will get another screen for SVG Options - click 'Ok'
4. Open this file up in SublimeText or your preferred text editor. Here, you will see the SVG in XML format.
5. If you want to nest this SVG inside your HTML document, you can include the SVG attributes(from that XML file) inside an SVG tag, like this:
<body> <svg width="200" height="200"> <circle cx="25" cy="25" r="25" fill="red"></circle> <svg> </body>
THINGS I LEARNED ALONG THE WAY:
* The styles should be pulled out to a CSS file.
* The SVG must have explicit width and height.
* The SVG saved directly from Illustrator isn't optimized - meaning it comes with some extra junk, like a DOCTYPE and generator notes. I've used Peter Collingridge's online SVG Optimiser tool: http://petercollingridge.appspot.com/svg_optimiser to make working with SVG easier.
* If you want to dynamically append SVGs to the DOM, I found that it did not work using jQuery. It turns out jQuery only understands the HTML DOM and not the SVG DOM. As a solution, I have started to learn D3.js, a data visualization library - which lets you append an SVG to a DOM element using the d3.select method.
Here's a great tutorial: https://www.dashingd3js.com/adding-an-svg-element
1 note
·
View note
Text
Obscenity Gem, a profanity filter.
Have you ever wanted to filter out certain words from user generated text in your web applications?
Recently, I worked on a project that targeted a younger audience. Users are able to input a name for something they create on the site and I wanted a way to prevent the posting of curse words.
Initially, I implemented this feature by creating an array of common curse words and looped through the users' input to see if it included curse words from the array. If it did , I would replace that word with asterisks. But then I found the Obscenity Gem, which is a profanity filter for Rails through ActiveModel. They have an extensive list of profane words and there's even an international list too, which certainly covered more bad words that I could list!
I really like the way Obscenity used regular expressions to reliably replace the bad words. Additionally they provide 6 different replacement methods, my favorite is the ability to replace the word with a custom string.
Here's a brief tutorial for how I implemented it in a Rails project:
1. In your application's Gemfile, include:
gem 'obscenity'
2. Bundle Install
3. To add the validation on your model:
require 'obscenity/active_model'
4. Inside the model, include:
validates :body, obscenity: { sanitize: true, replacement: "Censored" }
If you're running into problems with validations, try using a before_save call back instead:
before_save :filter_obscenity def filter_obscenity self.name = Obscenity.replacement("Censored").sanitize(name) end
Happy filtering!
https://github.com/tjackiw/obscenity
0 notes
Text
Graduation.
Today was the last day of my web dev intensive course at NYCDA. When I first started teaching myself to code, I was like "oh this is really awesome - too bad I was never exposed to this earlier. Maybe this is unrealistic and too challenging for me?" When I found New York Code and Design Academy, I took a leap of faith and dropped everything I was doing to emerge myself in learning this new skill. Over the past three months, I did nothing but eat, sleep and code. I was really excited about coming to class everyday and being surrounded by really smart and creative classmates and instructors. With every project I built and problem I solved, I grew to love programming even more. I'm sad that this amazing experience is ending, but looking forward to my new future. Thank you to NYCDA and my teachers and classmates for making this possible! Up next... I'll be spending the next week reviewing, refactoring and continuing to code everyday!
1 note
·
View note
Text
Hacking the Universe
It's intimidating to be in a room with so many brilliant and talented people - and it was tough to get over the initial fear of feeling like you may not have the skills to contribute to a project, but don't let that stop you from participating. I had a great time at my first hackaton. I learned a whole bunch (used haml and coffeescript for the first time in a rails app and got to see how awesome JavaScript is ). I am proud to be part of the interactive educational app we built to engage students in space exploration. I can't wait to go to another hackaton ...It's so amazing what people can accomplish in one night! A night at the amnh museum and unlimited snacks are added bonuses!
0 notes
Text
Project super awesome, complete!
We spent the last week working on a final group project. There was a lot of pressure to make it super awesome, and in my opinion - it is. It’s such a pleasure to get the opportunity to collaborate with others. I’ve learned so much :)
After 5 days of 5 hours of sleep a night, I’m surprisingly super energized for the Hack the Universe hackaton to tonight!
1 note
·
View note
Photo

#hacktheuniverse - so excited for tonight! (at Hayden Planetarium @ The American Museum Of Natural History, NYC)
1 note
·
View note
Text
So - I took a two week Tumblr hiatus, during which I learned Rails and really thought I had reached my limit with learning how to program. The first week was tough - and I was overwhelmed with the amount of stuff we had to know. It felt like we were introduced to a new thing even before I had the chance to wrap my head around the previous lesson. I came home most nights with a massive list of things to read up on.
I grew frustrated as the week progressed, as it felt like I wasn't really learning anything. We had a code along lesson last week and that was the day I came home feeling like I was in over my head. I may have understood 50% of what we did and that made me lose a lot of confidence. During this time, I received some really good advice from someone who had been through one of these intensive programs: remind yourself that it's okay, this is the learning process and it's why I'm a student right now. It's tough getting yourself to that place, but when you realize you have to wake up the next morning to learn yet another new thing - you kind of don't have a choice, but to embrace this whole process. Yup. It's okay, I don't know everything - I'll never know everything. What's important is that I definitely know so much more than I had last month - more than I had imagined possible. And that's okay.
We're back in the front end this week - learning SCSS, which is so much fun! ... glad it's Wednesday and I don't want to pull all my hair out :)
0 notes
Photo

And this is how people learn corging… whoops, I mean coding.
725 notes
·
View notes
Text
Building a Microblog
Spent the last two days of class (and all weekend) working on a microblog site with one of my classmates. This project constantly pushed us to the limit of our knowledge of Ruby, Sinatra, ActiveRecord, databases and Git. When starting the project, I felt like I had 50% of the knowledge needed to implement the features for our site - we had to teach ourselves a lot along the way (which included a lot of googling and trial and error).
Just a few of many lessons learned:
1. During my other group projects - there was always someone in the group who knew Git pretty well and that was the go-to person for Git issues. We're both not experts at using Git so it was a rough and frustrating start for us. However, since we didn't have someone else to depend on to fix our merge conflicts, we were forced to learn it... which, as our teacher says - it's better that we're learning this stuff now, and not on the job! I also learned how to create a gitignore file for sqlite databases, so that it doesn't get committed to the repository.
2. Sometimes your code breaks and you have no idea why. I'm beginning to learn that a good approach to debugging can be to recreate the code in irb and test it out there.
3. Our main priority in building this app was to focus on functionality and user experience - which really helped to shape our development approach. For example, we knew the first thing a user would need to do to visit our site was to sign in. This was the first feature we built. Next, they will be looking at their homepage... we also did a lot of testing along the way, ensuring that our app didn't break with each new feature. Lastly, we saved the front-end/design for the end. I'm not sure if this is the best work flow - but it worked well for us!
Knowing that all our features work as expected, we can now spend the rest of the day making it look awesome. Back to work ...
0 notes
Text
A Typical Week
What weekdays look like now: I wake up at 7:30 am, get to NYCDA around 9:15 am - 45 mins to have coffee, review the day’s power points, and catch up with other early birds in the class. I generally leave class around 6 -6:30 pm and get home around 7:30 pm. After having dinner, I grab my laptop to review what I’ve learned/didn’t understand and try to work out all the exercises I didn’t finish in class. Around 1 am - when all the text on my screen start to look blurry, it’s time for bed!
Since starting the WDI course, I haven’t really found time to blog during the weekday. However, it’s been an emotional roller coaster for me this week so I am pushing myself to document this.
This week we’re learning about Databases and have been using ActiveRecord, Sinatra, and SQLite. I expected this to be difficult and was prepared for the challenge on Monday. We had an introduction to PostgreSQL, which I felt pretty good about. I got this.
On Tuesday, we learned how to use ActiveRecord with Sinatra. I’ll be honest - the entire lesson went over my head. Our teacher went through the slides at a fast pace, and I was always a step behind. I was extremely frustrated and struggled to catch up. When it came time to work on some exercises, I felt completely lost. What am I supposed to require? And where do I do that? Creating a db … migration, rollback, huh?! That night I came home and just wanted to give up. I felt like everyone in class knew what they were doing and I just kept getting error, after error. If I can’t even load my files, how will I ever learn how to program! I cried about (in retrospect - maybe I overreacted a bit) and decided to take a break. I took a nap and had a bunch of snacks. While emotional eating is a bad habit, it made me feel better. With fresh eyes and some renewed patience, I was able to figure out the root of my error - victory!
This morning, I came in to class early and wrote down the step by step process for creating a new Sinatra app that uses ActiveRecord, I wrote down the commands needed to create new tables and columns in the database and practiced ActiveRecord methods. I realized that writing things down really helps me to memorize the steps/commands. I felt pretty comfortable implementing what I learned to create a Sinatra app that uses all the association types.
I was at a high until we learned about processing forms data. Now I'm back to feeling completely confused!
So that’s the typical flow of my week.
(I’d like to thank the people in my life who have been so supportive - especially putting up with my emotional roller coaster.)
2 notes
·
View notes
Text
Time flies...
Just completed 1/4th of the WDI course at NYCDA. I feel like there's too much to know and so little time! In class this week we had a new instructor and also began learning about the backend. Goodbye JavaScript, hello Ruby & Sinatra! I was told we'd find Ruby to be easier, but so far that hasn't been true. This weekend I gathered a lot of online resources so hopefully more reading and practice will help.

1 note
·
View note
Photo

Getting inspired at this morning's conference #GetRealNYC (at The Times Center 242 West 41St Street)
0 notes
Text
WDI week 2, check. Learn JavaScript & jQuery, check.
I struggled at first to solve programming exercises using JavaScript, but after picking up some tips in class - I have a whole new approach to writing programs.
Here are some of the things that I found helpful:
1. Pseudo code. As much as you may want to skip this step and jump right into coding (I definitely did at first) - I learned that you can save time (and avoid a headache) if you just dedicate a few minutes to writing a detailed outline of your approach in plain english. I find that writing pseudo code lets you focus on the logic. Once that's complete, figuring out the syntax becomes an easier task.
2. Ask for help! Sometimes it's hard to admit that you don't understand something. Especially when you're in a class with people you don't know too well. No one really wants to be that person that holds up the class because they don't get it. But then you have to believe that if you don't understand something, someone else probably feels the same. Ask the instructor for a review - we had one in class on Friday and it was definitely what I needed to solidify my understanding of the things like scope, loops and conditionals. Hopefully it was helpful for others as well!
3. Think like a programmer. In learning how to program - I find it most helpful to ask the instructor to think aloud and learn from their thought process. Listen to how they identify the goal and break down a problem.
4. Stay organized. Keeping track of these: { [ ( : ; " as you write your code, and making sure that your indentation is correct will really help keep those "Uncaught SyntaxError" away.
5. alert("to test your code") || console.log("just about everything"). Alerts can be kind of annoying when you use too many, but they can really help you figure out if parts of your code is working the way you want it to. Also if you are frustrated and your program isn't working - try console.logging each line of your code to see if it's what you expect, it's a great way to locate the error.
6. Read. It's impossible to learn all there is to know about JavaScript in 35 hours (1 week of classes) - as per the recommendation of many classmates, I picked up a copy of Jon Duckett's JavaScript and jQuery: Interactive Front End Web Development. Although we're starting a new topic - this will be my train reading for the rest of the week. So far - I'll say it's a great resource! Definitely not dry, like many textbooks out there.
That's all for now!
0 notes