Dev box
I'm a 32-year-old Ruby on Rails web developer. With the help of friends and co-workers, I've been teaching myself Rails. I worked as a Rails developer for Crowd911 in Colorado. I live in Berlin.
In my developer blog I publish a stochastic array of thoughts and ideas, lessons, mistakes, questions and attempts as answers about Rails and Ruby. I am also posting Anki cards that I used to help myself study. In my view most knowledge is about practice. If you have thoughts, questions, ideas, corrections, arguments, feel free to email me at henryvw@gmail.com.

Learnings from Debugging URL GET / POST Form Requests

You can submit a form using EITHER GET or POST. Using POST it submits seamlessly, "silently". Using GET it can submit a long URL with details.

When Debugging GET Requests, use a URL Decoder such as this one: http://meyerweb.com/eric/tools/dencoder/ to help you understand the elements that are getting passed there. WHY use a URL Decoder? Really the only key reason is because HTTP URLs translate certain characters like "[" into like "%3" and so on. So you translate those back into human-readable characters.

And keep in mind, you just need to get the GET request to MATCH the other type of request... it just needs to be in the identical format


Great resource to play around with forms: http://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_submit

Read More
HTTP, GET, POST, Forms

Sym Links - Can Be Absolute ( / at beginning) or Relative

http://superuser.com/questions/422473/vim-doesnt-load-symlinked-vimrc

Symlink targets can be either absolute (starting with /) or relative to the symlink's location. Since the symlink is located in /Users/simont/ and has ".vimrc" as its target, it is essentially pointing to itself.

Try recreating the symlink using a correct path: (note that the target is stored in the symlink exactlyas given in command line, without considering $PWD)

  • Relative:

    ln -sf repositories/config-files/.vimrc ~/.vimrc
  • Absolute:

    ln -sf ~/repositories/config-files/.vimrc ~/.vimrc 

(No, I don't know why it works when opened for editing...)

Read More
VIM, Symlink

Search and Replace in Multiple FIles in VIM world (with SED)

VIM does not support search and replace in multiple files, so you need to use the core UNIX command of SED.

How can you use SED to do this type of search? 

Mac has some differences with the original SED, and so sometimes you need to use instead "man sed." You also need to 'escape' the VIM interface, so you need to use an exclamation point, like this :!man sed

In theory a command like this should work, maybe:

 

:!man sed -i 's/old/new/g' logfile*

In practice, this doesn't work. 

Read More
VIM, SED, Search and Replace in VIM

Ack - searching through a particular file type

//Search through only C files
Ack --cc 'search string'

//Search through only Javascript files

Ack --js 'search string'

//Search through only Ruby files
Ack --ruby 'search string'
Read More
VIM, Ack

Names and Programming

A big lesson for me in programming is that, the WORDS and NAMES of METHODS, CLASSES, MODULES, FUNCTIONS, OBJECTS, whatever you want - these names do not MEAN something in and of themselves. These names are simply "pasted on" and MOST programmers are TERRIBLE at naming. The way that real programmers like Tim look to understand a FUNCTION or METHOD or CLASS etc. is by searching back through its definition and uses in other situations and contexts. THAT is how they then UNDERSTAND what the method does. 

AND they do this again and again - if one or two of the methods called INSIDE that method doesn't make sense, they then look up THOSE methods.

Read More






Footerfull