Programmer of the Day
_Why the Lucky Stiff
- Tesla: 1909 predicted the internet and wireless communication
Stuff I read
One page script - Difference between map and collect
CSS selectors are hard - need to keep this handy
DB prepare: If the same statement is going to be executed repeatedly, you can speed things up a bit by preparing the statement.
xpath: for very specific selectors
1 2 3
In rails, but not in the ruby library.
DB drivers in SQLite3 does the sanitation.
nokogiri supports a “/div li.a” syntax, which is more common than the doc.css(‘div li.a’)
Mark Up Languages
SGML -> standard generalized markup language XML -> extensible markup language HTML is an extension of XML.
dtd - document type definition html5 is a new dtd published standards committee
logical expression (true or false) this is good for the pattern:
1 2 3
reg ex are pretty much patterns– all languages implement them the same Remember rubular for regular expressions (regex).
if you have email1 and email2 and phone1 and phone2, it’s time to break out another table. Store vertically, not horizontally.
If you see an each block with a push in it, you should be using a collect
- (e.g. p~ul)
- Selects every
- element that are preceded by a