Posts

Showing posts from July, 2014

Gordon Ramsay Principles

I am a big fan of Gordon Ramsay's "Kitchen Nightmares". But after you watch season after season, you start predicting what kind of advice Ramsay will give to every single failing restaurateur. There's 3 things:

1) Clean up your kitchen
2) Make your menu smaller
3) Fire dumb people and hire good ones

These 3 tips, seem so obvious and self-evident, and yet are forgotten by these failing restaurants everywhere. I believe it's because when you are deep in the weeds of action, with so many insurmountable stresses, pressures and problems in your face, you start becoming blind to the obvious.

But I take these 3 tips dear to heart and found a way to relate to my current situation. While teaching myself coding and learning all these things, many times I felt like banging my head against a wall and kinda felt like the captain of a sinking ship or the manager of a sinking restaurant. It was easy to get overwhelmed with so many things: what kind of things I should study, what kin…

Completed Week 12!!

Finally have another decent Rails project to showcase on my portfolio! Pretty proud of this one.

These past 3 months have really gone by like a lightening. For anyone who wants to embark on a similar "self-learning" journey into coding or whichever craft, I have a few tips

1) Balance in your daily rhythm is crucial
Sitting by yourself alone in the apartment for 90 days straight and studying is a pretty grueling process, now that I look back on it. You need a plenty of good exercise, social activity and relaxation time mixed in with all that studying, or sooner or later, you may have a mental breakdown from stress.

2) Stress management is crucial
If you think about it, all the studying is basically a fight against yourself. If you can get your butt down in front of the desk and get the work done, yes you will do fine learning new skills. Trouble for most people, is that it's extremely stressful to do it day in and day out. I myself was stressed out severely and sometimes resor…

Stress

Getting CKEditor to work for Rails 4 in Production

If you have a lot of existing data in Word docx format, you might want to keep all that formatting when you want to put all that text content into your app.  For my Book Notes app, I didn't want all my pretty highlighting, bolding, and font-sizes to go away when I pasted it into a form through Rails.

Thankfully, found CKEditor through tips on Stack Overflow. It's AWESOME and EASYYY ... at least in development! Amazing web text editor that puts pizzaz on your default form textarea, giving you a lot more control over the formatting. But then, it bit me in the ass when I tried to use it for production. There's a long thread of problems on SO but here's the combination of solutions that worked for me!!

My First Impression:
1) It's just a package of JavaScript files. Put ckeditor folder in your vendor/assets/javascripts folder and you are good to go
2) Installing is a breeze at their website, selecting different functionalities as you see fit  http://ckeditor.com/
Problem: CK…

Getting Paperclip, ImageMagick and Rmagick to work on Windows and Rails

Paperclip is a Ruby gem that you can use with Rails to easily upload images and associate them with your objects. However, using it on Windows becomes a HUGE BITCHY HASSLE when you incorporate "image resizing" because it requires other server-side software like ImageMagick to work properly.

Just took me hours to get this setup right on Windows 7. Aggravating!
But finally got it working, just wanted to share.

Given:
Ruby 2.0.0

Common Errors:
Invalid drive specification --> Look at steps 2, 3 and 4
QuantumDepth is not supported --> Step 1

1) Install an older version of 32-bit ImageMagick
**Even if your Windows OS 64-bit, only 32-bit seems to work
**Don't install the latest version of ImageMagick ... causes compatibility error of something like "rmagick.h:81:2:error:#error Specified QuantumDepth is not supported."
 (ImageMagick-6.8.7-8-Q16-x86-dll works fine on my computer)
**Select the options ‘Add application directory to your system path‘ and ‘Install development hea…

Laws of Learning quoted

Law of Readiness
Student has to meet the teacher halfway and be motivated to learn. Otherwise, if they see no reason for learning, they willl face difficulties.
Law of Exercise
You must drill, repeat and practice to learn something
Law of Effect
If a student feels a task is difficult, they lose motivation to learn.
It is better to tell students that a problem or task is within their capability to understand or perform. A student’s chance of success is definitely increased if the learning experience is a pleasant one.
Law of Intensity
The more intense the material taught, the more likely it will be retained. A sharp, clear, vivid, dramatic, or exciting learning experience teaches more than a routine or boring experience. A student is likely to gain greater understanding of tasks by performing them rather than merely reading about them. The more immediate and dramatic the learning is to a real situation, the more impressive the learning is.
Law of Freedom
The student must be free to learn whateve…

Freaking libraries

Borrowing code from other people ...

It's both a blessing and a curse.

It's a blessing because you can leverage their knowledge so you don't have to do things by yourself, saving time.

But then if you get any problems down the future, you have NO IDEA what's wrong with the code.

AHHHHHHHHHHHHHHHHHHHHH

It's a lot better, as a student, to always know how to go back to the fundamentals, IMO.

I want to know how to build things from scratch, not always rely on other people to find the answers for me.

But then again, without libraries, it would have been so much time-consuming to build even simple apps.

I guess the best approach is to rely on common libraries for mundane tasks, while taking the time to really go deep and master code that's important for you to understand and build from scratch to manipulate in the future.


Completed Week 11: AngularJS and contribute more

Codeschool with Gregg Pollack has some GREAT intro videos to Angular. Not only were they really fun, they were very easy to follow along. Haven't had great videos like them for awhile. Finding great learning resources like that is like finding a small oasis in the smack middle of the desert. Saves you from all the frustration and stress.

Skimming Angular was fun because I got to understand how powerful it really is, but am having trouble how to integrate it for personal use. -_-;

Anyways, lately I've been pretty stressed out.
With time running out of my "3 month period", and time running out on my savings lol, I am in crunch mode lately, which hasn't helped me at all. You would think I'd be even MORE motivated to study harder and quicker. Turns out STRESS is your worst enemy when studying. It makes you want to escape. It makes you really frustrated and unable to think. Lately, with worries about my future, job prospects, and frustrations over brick-walls, my lea…

Completed Week 10: Advanced JavaScript

Delved into a few deeper concepts into JavaScript, learning how to use JSON through other APIs.
APIs are frustrating because I thought I would be able to pull all kinds of awesome data from websites like Facebook, LinkedIn, etc. The reality is, there's so much authentication and security around data that you can't really get the data that you want. Fortunately, Twitter's API is fairly open (despite its authentication hassles) and I was able to build a simple program using Twitter's Search API.

Took me a long time to realize that Rails Turbolinks basically utilizes AJAX by default, making your app really fast. -_-;; I was taking like 3-4 hours trying to implement AJAX on some pages on my Rails app, and going, "Why isn't this changing anything!?" Ironically, Turbolinks had taken care of everything. Well, trial & error. I guess when you are trying to teach yourself these things, you get these little blind-spots and skip over these things.

Being able to lev…

Upward Spiral, Downward Spiral

We tend to exaggerate the "fixed innate differences" between people. "One is born smarter than another. One is born stronger than another. And that's just the way things are".

But I believe stronger in the intense power of growth through behavior. The very things we can control, the very things we can tap into and master, to change our future. We do not have to be the same people we were yesterday. We might not have been conscious of it in our teens and early 20s, but we are not victims of our past. We can literally tap directly into our behaviors and build up our new future.

Psychologists seem to describe this phenomenon as a "Spirals" or "Loops". And there exist "Upward Positive Spirals" that propel you to greater self-confidence, job satisfaction, self-discipline and better relationships, and "Downward Negative Spirals" that drag you down to depression, stress, self-doubt and anxiety. And these "loops" define t…

Heroku PostgreSQL Import and Export Database for Rails app

Heroku is a really easy to way to push your Rails app on the web.
But working with the database can be a bitch.
1) You can't use the default Rails sqlite3 on Heroku. You have to use postgresql.
2) Copying the development database (which you were working with at localhost:3000) to the production database (up on the Heroku server) is a pain
Hopefully the below tips will help you with using postgresql. Just a compilation of all the tips I gathered on the web.


Push database to your app on Heroku (For Rails)

1) Go to a folder and run below command to get a dump of your development database file
pg_dump -Fc --no-acl --no-owner -h localhost -U (username) (dbname) > (anyname).dump
Type your password when password prompt comes out
**replace () values with whatever names ... (dbname) is the name of the dev database you were working with.
Now, you will have the .dump file in whatever folder you ran this command on

2) Now, you need to connect this dump with your HEROKU DATABASE
**remember that Heroku …