Skip to content

Instantly share code, notes, and snippets.

View kriscooke's full-sized avatar

kriscooke

  • British Columbia, Canada
View GitHub Profile
@kriscooke
kriscooke / ruby_webserver.rb
Last active August 29, 2015 14:07
Simplest Possible Ruby Web Server
# The Simplest Possible Ruby Web Server. It serves up all the files in the current directory;
# use when developing static HTML/JS pages locally without a backend framework like Rails or
# Sinatra and their associated servers. This was useful for me in avoiding XMLHTTPRequest errors
# in Chrome, triggered by running a page on the local file protocol and trying to AJAX request
# an API resource via HTTP. The browser will believe you are making a cross-origin request unless
# the request is coming from both the same domain as the requested resource AND via the same
# protocol (file/HTTP/etc).
ruby -run -e httpd . -p 3000

On the road to being a Power User

Take control of your development environment by using more of the keyboard and less of the mouse/trackpad. As you write your code, use (Mac and Sublime) keyboard commands/shortcuts to, well... kill it!

Mastering your text editor and Operating System (OS) will make you a more efficient and impressive developer.

Power User Commands

Don't just read about these. If any of these are foreign / unfamiliar to you, be sure to practice them and make a mental note to use them when possible.