BC Blog

Chase Excellence, Success will Follow

0%

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'net/http'
require 'uri'
require 'json'

def send_request(dep_dns, current_question, current_reply)
uri_path = "/panel/ask/back_end/ask_requests/auth_request"
uri = URI.parse("http://#{dep_dns}#{uri_path}")

body = { 'auth_token' => '3kjlfksjDFJ' }

http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
request.set_form_data(body)
response = http.request(request)
puts "Response #{response.code} #{response.message}: #{response.body}"
end

After then, we write a route for the request to take place, and build a controller action to send back the corresponding response.

Rails server runs the development server on default, in order to open another one for HTTP communication test, we need to apply few options on rails server command.

1
$ RAILS_ENV=production rails s --port=4000 --pid /home/bernie/orbit_intern/orbit/tmp/pids/server_p.pid

Books

Communities

Conferences

Deployment

Documentation

Gems

Installation

Integrated Development Environments (IDEs)

Interactive tutorials

Libraries

Newsletters

Online publications

Online tutorials

Other platforms

Podcasts

Problems & Puzzles

  • codewars: a challenge-based learning tool that has a wide variety of difficulty levels - http://www.codewars.com
  • Project Euler: a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve - http://projecteuler.net/
  • PuzzleNode: a site for coders who enjoy to work on challenging problems - http://www.puzzlenode.com/

Quizzes

Terminals

Testing

Text editors

Since I first started learning Rails on March, 2013, I kind of got it now how all those neat little stuff work. MVC architecture is something hard to pick up at first because I have to run into different files to modify my pages and settings. I wonder why I couldn’t just write codes in straight ways like in PHP (maybe I’m just not good enough in PHP to learn MVC at first), but few weeks later, I came to realize by keeping those codes in MVC structure could actually make the overall application organized in a very decent way.

Rails Tutorial is the top free resource for learning rails recommended by many StackOverflow users. Of course, I took the recommendation respectfully, so I undoubtfully picked up the book from Amazon. This is a great book, but it kind of forces you to learn everything at once that one has to develop in Rails. I would suggest people reading this book twice because there are still many tips to pick up even though I could still make a web app without implementing those in my codes. However, those tips might include extra security features and nice coding techniques that most developers wouldn’t want to miss out. While those may be quite confusing at first, tips are actually like subjects for intermediate Rails developer. As I progress through the chapters, I become more confident to understand those advanced topics. Therefore, reading it twice really makes me more comfortable at building Rails apps.

There are still lots to learn in Rails. Testing, MVC, Git and Ruby are still new to me. I believe no one could just learn everything in a month or two (Even I know how they works, I can’t remember them all. After all, I need to remember those main features and type codes at ease like a pro), so I just have to keep on practicing. Look for more resources like Rails Casts and Ruby Programming Language from various authors.

I didn’t code quite often when I studied in college first few years. Even though the school was teaching all sorts of programming languages, I was still wondering what I could achieved with all the school trainings. Teachers were just simply giving us out all the boring assignments like mathematical or data structure problems, not telling us how the real world coders were like. After a year of C++ classes, I still had no idea how to program a complete software. Besides, I see none of my classmates building anything interesting at all and the their codes had no stuctures (No OO patterns, No Architectures, just gibberish). Even Facebook founder, Mark Zuckerberg, could build a Facebook in his freshman year which astonished those close to him. (Maybe my college sucks, or maybe just simply Mark learnt how to code in his early age)

After all, I still enjoy all those computer stuff on the Internet and wonder how they build it. But when did I start building my own web project? Fortunately in 2012, I discovered Codedcademy, which gives me a lot of inspiration and after that my progress has grown in a big leap.

Even though some of the trainings are difficult for me, the excercises are all on-the-hand experiences. I could see the result instantly and all the computer enthusiasts are gathering around the site. They share their obastacles and problems and willing to help other new programmers. It’s a pleasant environment to learn how to code.

After few months of self trainings, I was hired by a charity group and built a static website for them. With all the help I could get like Stack Overflow and Open Source. my website covered with a few animated effects crafted with jQuery and few of my HTML, CSS and JavaScript FrontEnd skills. Since then, I’ve begun to enjoy the beauty of web technology.

Not until recently, I also discovered another website called Code Conquest. It explains all my doubts and problems. The site provide lots of information for people who want to become a good coder or web developer. And now, I believe I’m more a confident coder than ever before.