News for hackers. Stuff that matters.
Re:Heroku Fucking Console by shocks on Friday March 01, 2013 @11:28AM (#5305140)
I understand your frustration, but what if the program thinks you're doing something you're not? You may do irreversible damage. I guarantee that you'd be far more pissed if you trashed an entire project than you are about 'shitdick excuses'.
Re:Heroku Fucking Console by nailer on Friday March 01, 2013 @11:40AM (#5305252)
Sure, but:

    heroku console -> heroku slightlydifferentsyntaxforconsole 
is not one of those cases.
Re:Heroku Fucking Console by pygy_ on Friday March 01, 2013 @11:43AM (#5305272)

    $ git statis
    error. Did you mean status? Y/n
You'd get the best of both worlds.
Re:Heroku Fucking Console by cowpewter on Friday March 01, 2013 @12:57PM (#5305779)
I want git to do that so badly. It's not like its output is particularly pipe-friendly anyway. Just ask me, don't make me type the whole thing again. Especially annoying when it's a longer command with a bunch of arguments or one that in no way could have negative side-effects, like git status or git log
Re:Heroku Fucking Console by cpr on Friday March 01, 2013 @01:45PM (#5306088)
Re:Heroku Fucking Console by cowpewter on Friday March 01, 2013 @02:58PM (#5306595)
Thank you so much.
Re:Heroku Fucking Console by nitrogen on Friday March 01, 2013 @01:32PM (#5306013)
Why are you typing the whole thing again instead of using the up arrow or Ctrl-P?
Re:Heroku Fucking Console by masklinn on Friday March 01, 2013 @02:17PM (#5306320)
zsh can do that:

    > ce somedir
    zsh: correct 'ce' to 'cd' [nyae]? y
Re:Heroku Fucking Console by loeg on Friday March 01, 2013 @09:53PM (#5308246)
Ugh, this is my second least favorite "feature" of zsh. (First is "are you sure you want to delete all of the files in this directory?")
Re:Heroku Fucking Console by masklinn on Saturday March 02, 2013 @04:41AM (#5309066)
I find it quite handy and it can quite trivially be disabled if you don't like it. Not sure what's not to like.
Re:Heroku Fucking Console by loeg on Saturday March 02, 2013 @04:25PM (#5311131)
It's on by default, so you have to disable it every time you set up zsh on a new machine. Yes, it's not a big deal. I just find it annoying.
Re:Heroku Fucking Console by bluetech on Friday March 01, 2013 @12:25PM (#5305585)
Use an alias! I like

  git config --global alias.s 'status --short --branch'
Re:Heroku Fucking Console by aerolite on Friday March 01, 2013 @01:01PM (#5305815)
Ok, but please don't alias statis to status. That's a horrendous typo.
Re:Heroku Fucking Console by enjo on Friday March 01, 2013 @11:52AM (#5305342)
The old "DELETE FROM some_table" <enter>

Crap.. I meant "DELETE FROM some_table WHERE id=1"

sighs

Re:Heroku Fucking Console by vidarh on Friday March 01, 2013 @01:55PM (#5306160)
The MySQL command line client has an argument "--i-am-a-dummy" that refuses to run UPDATE and DELETE's without a WHERE clause.

More commands could use options to adjust how big guns they let you fire at your feet with...

Re:Heroku Fucking Console by gknoy on Friday March 01, 2013 @04:58PM (#5307199)
Such options might be more appealing to users if it were named something like "--extra-safety" or "--require-where".
Re:Heroku Fucking Console by NSAID on Friday March 01, 2013 @05:36PM (#5307408)
Re:Heroku Fucking Console by sneak on Friday March 01, 2013 @05:00PM (#5307215)
...which is not the default. Fuck them.
Re:Heroku Fucking Console by iaskwhy on Friday March 01, 2013 @12:26PM (#5305590)
I always SELECT first and confirm I got the right result. Then I add the DELETE just before SELECT and commment out the SELECT line. Never fails!
Re:Heroku Fucking Console by naudo on Friday March 01, 2013 @12:11PM (#5305470)
After doing that on a local db a couple of times, I started just writing the where clause first. Goes like this

WHERE id = 1 ctrl + a DELETE FROM....

Found it's also helpful for writing SELECTS and avoiding the whole "oh crap, now let's load the entire DB" type of moments.

Re:Heroku Fucking Console by schrodinger on Friday March 01, 2013 @01:33PM (#5306017)
If you're in a GUI where you can run only the highlighted code, I do this:

    select * -- delete
    from sometable
    where id = 1
Then you can run the whole thing to see what would be deleted, and highlight starting at the word delete to actually delete.
Re:Heroku Fucking Console by methurston on Friday March 01, 2013 @02:57PM (#5306587)
I do this too, If I'm saving the file for reuse, I wrap the entire thing in /* */ when I'm done just in case I accidentally hit run script instead of run statement.
Re:Heroku Fucking Console by TrunkleBob on Friday March 01, 2013 @03:31PM (#5306772)
Do that once on a production system in the middle of a shipping run. Lesson learned.

All my deletes written first as selects now, as a sibling comment suggested.

Re:Heroku Fucking Console by ams6110 on Saturday March 02, 2013 @10:21PM (#5312349)
That's what transactions are for. you realize the mistake, type ROLLBACK, and move on.

Oh yeah, you're using a toy database aren't you.

Re:Heroku Fucking Console by rwallace on Friday March 01, 2013 @10:32PM (#5308338)
The solution to that is to make potentially damaging operations reversible, not to throw the problem back in the user's face. In fact, this is a very reliable design smell: any time you find yourself throwing something back in the user's face, stop and think about the problem for a few minutes. 99% of the time, the right solution is to provide more reversibility instead.