Profile
Achievement
cczona's Recent Snippets
- All /
From the Pickaxe, 4th edition, p. 352:
A rescue clause with no parameter is treated as if it had a parameter of StandardError. This means that some lower-level exceptions will not be caught by a parameterless rescue class. If you want to rescue ev...
1
815
posted 13 years ago by cczona
See also http://www.gnu.org/software/bash/manual/bashref.html#Bindable-Readline-Commands for the standard bindings and more detailed explanation of what they do.
0
938
posted 13 years ago by cczona
[See also: http://snipplr.com/view/12048]
Oops, didn't mean to commit that? Undo it easily:
0
774
posted 13 years ago by cczona
Examples borrowed from http://ubuntuforums.org/showthread.php?t=966877 (comment 3)
0
802
posted 14 years ago by cczona
The 'request' and 'response' objects are chock full of useful info. But console can't usually access them. Here's how:
start the server with the -u option, insert a breakpoint where you would like to have access to the controllers/helpers/etc. Wh...
1
945
posted 15 years ago by cczona
[See also: http://snipplr.com/edit/45271]
Oops, didn't mean to commit that? Undo it easily:
0
733
posted 15 years ago by cczona
'port install ruby' sometimes results in malloc errors near the final phase (just after destroot completes). It appears that macports may be out of memory while installing documentation.
0
678
posted 16 years ago by cczona
Suppose you created a script chart.rb in /home/foo/ruby/mylib direcory. Now, you want to use this in the app.rb located in /home/foo/ruby/scripts. In ~/.bash_profile:
0
690
posted 16 years ago by cczona
Changing default settings
The defaults for the ssh-related commands can be altered for each account in a configuration file ~/.ssh/config (there is also a system-wide file, usually /etc/ssh/ssh_config). Each entry starts with a Host keyword. You c...
0
724
posted 16 years ago by cczona
Check out the bash command 'shopt -s cdable_vars' From the man bash page: If set, an argument to the cd builtin command that is not a directory is assumed to be the name of a variable whose value is the directory to change to.
0
695
posted 16 years ago by cczona
(EDITED: Originally I had this snip using 'cat /proc/version'. But have since replaced it with a more reliable -- and specific -- method)
If you need still more info (or are on a BSD), see 'uname', 'dpkg-architecture'
1
680
posted 16 years ago by cczona
If Ubuntu Server fails to resolve hostnames or find a network connection via Parallels 3 bridged networking, it may be attempting to use the wrong network interface.
0
744
posted 16 years ago by cczona
Note: most of these will be available to the shell and Rails' console too.
2
869
posted 16 years ago by cczona
"When using haml, an HTML tag is represented using %tagname, but in the case of an HTML tag with attributes, the representation is %tagname{:attribute => value}.
It turns out there must be no whitespace between %tagname and {:attribute => value}....
1
752
posted 16 years ago by cczona
"The new naming scheme for template (eg. .html.erb) does not seem to work for partials. When using :partial => 'form' a filename "_form.html.erb" is not recognized. "
Rails now requires the partial to be referenced by dotted format
1
790
posted 16 years ago by cczona
Note that the comment is part of the code here. IE 5+ (including Mac) will evaluate to true by using conditional compilation.
0
798
posted 16 years ago by cczona
IE7 and IE8 support “No Add-ons Mode,†a troubleshooting mode. When you run IE this way, no 3rd party code runs... You can start No Add-ons Mode in a few ways:
(To exit No Add-ons Mode, simply close that browser window.)
0
841
posted 16 years ago by cczona
*"Only the elements which are are selected through the $ selector will get the extra DOMAssistant methods added to it."
0
611
posted 16 years ago by cczona
This is handy for testing, when you need to simulate an open file or open URI. Why, and the Pickaxe book, have better examples
1
781
posted 16 years ago by cczona