What do the &,

Up until now I have only used database.yml with each parameter called out explicitly, in the file below it uses some characters I do not understand. What does each line and symbol(&, *, <<) mean? How do I read this file? development: &default adapter: postgresql database: dev_development test: &test <<: *default database: test_test cucumber: <<: … Read more

How to write UPDATE SQL with Table alias in SQL Server 2008?

I have a very basic UPDATE SQL – UPDATE HOLD_TABLE Q SET Q.TITLE = ‘TEST’ WHERE Q.ID = 101; This query runs fine in Oracle, Derby, MySQL – but it fails in SQL server 2008 with following error: “Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ‘Q’.” If I remove all occurrences … Read more

In Bash, how to add “Are you sure [Y/n]” to any command or alias?

In this particular case, I’d like to add a confirm in Bash for Are you sure? [Y/n] for Mercurial’s hg push ssh://[email protected]//somepath/morepath, which is actually an alias. Is there a standard command that can be added to the alias to achieve it? The reason is that hg push and hg out can sound similar and … Read more

Git alias with positional parameters

Basically I’m trying to alias: git files 9fa3 …to execute the command: git diff –name-status 9fa3^ 9fa3 but git doesn’t appear to pass positional parameters to the alias command. I have tried: [alias] files = “!git diff –name-status $1^ $1” files = “!git diff –name-status {1}^ {1}” …and a few others but those didn’t work. … Read more