Oct
Ruby Debugger Primer
Very quick rdebug primer for using the debugger in Mongrel. <h1>Setting Up your Environment for Debugging</h1> gem install ruby-debug If you're in textmate go to Bundles > Bundle Editor > Edit Snippits...
Read MoreOct
Very quick rdebug primer for using the debugger in Mongrel. <h1>Setting Up your Environment for Debugging</h1> gem install ruby-debug If you're in textmate go to Bundles > Bundle Editor > Edit Snippits...
Read MoreOct
Quick cheet-sheet to help you remember when to type a singular entity or a plural.
Oct
Web Developer -- adds a robust set of tools to peek under the hood. Adds a toolbar to your windows to let you do things like disable Javascript, cookies, css, see field names for a form on the page etc. Firebug - the king of web...
Read MoreAll programming languages work this way, but still it is nice to remember that Ruby does this. >> n = nil => nil >> x # x is undefined, just showing you that NameError: undefined local variable or method `x' for...
Read MoreIn trying to write code to give me the full name of "next" month (in my case, November, as today is October 6), I just stumbled across this interesting little Rubyism. Indeed, as you'll see below, I'm simply trying to add one thing to another...
Read MoreCreate a file in your home directory here: ~/.gitconfig (The dot makes it invisible of course) In this file, you can configure lots of git stuff: [user] email = your-email@your-domain.com name = John Doe [diff] rename = copy # Always enable color, in all commands [color] ui = true [core] ...
Read MoreA good area to spend some time for someone new to Ruby is to understand about objects. This serves as a basic wrap-around over view of what you need to know to get going.
First off remember to use the .class method on any object too (in your IRB, for example), giving you its class name. If you’re playing along here, that’ll help.
You will need to know what object orientation is in programming for this to make sense, and I hope it is geared to people coming from an object orientation learned in a different environment.
Everything in Ruby is an object. Even true and false have their own objects. Occasionally operators (like << and ||) are language contructs, but that's really insignificant for the purpose of this lessen. When we say nearly everything in Ruby we mean everything you think is an object and then some. Other languages have what are called primitives -- numbers, integers or floats; strings; booleans, etc. These things are see by the compiler and treated as what they are. But in Ruby all the primitives are objects too: numbers, strings, even boolean operators have their own classes. So, you can do things like ask an object if it is a nil object. Since it is used to return a negative meaning to an operation or a non-result, it's a good way to catch edge cases. False and nil are trip-ups for programmers coming from other languages where because false does not evaluate to 0 and true doesn't eval to 1.
Sep
Sep
Symbols used in CSS symbolnamewhat fornotes .dot (period)denotes class value #pounddenotes id value *staruniversal selector spacedescendant selector ,commagroup selector :colonused for pseudo-classesonly :hover and :active are supported by older IE versions; different pseudo-class support based on browser > greater thanchild selectornot supported by IE6 & earlier +plusadjacent selector CSS3 only [ ]bracketsattribute selector CSS3 only ...
Read Moredef hilite_search_criteria(pattern, search_criteria) return if pattern.nil? or search_criteria.nil? pattern.gsub!(/(]*>)|\n|\t/s) {" "} match_char = pattern =~ /#{search_criteria}/i matched_string = $~.to_s return if match_char.nil? start = match_char - 25 start = (start < 0 ? 0 : start) unless match_char.nil? p = pattern[start ...
Read More