The Terminal on macOS offers quite an amount of functionality, but most of it is hard to discover unless you already know what you’re looking for. So here’s a quick cheat sheet explaining unique functions with their corresponding key combos: Marks Marks allow you to mark certain lines in the output, and allow you to jump between different parts of the output. By default, every time you hit enter…
You probably know the feeling. You’re writing a piece of code, and just by looking at it, you know it could be better – but you don’t know how. You have that feeling that the right solution is just around the corner, if only you could reach it… but you don’t, and you have to live with whatever you’ve got. You have to live with the knowledge you were not good enough to write better code. This…
One feature of any shell that is immensly useful is the history. Any command you made gets recorded, and you can then retrieve it later on with various commands (my favorite: Ctrl-R , which allows you to search through your history). At any given time, I usually have anywhere between 10 and 20 terminals open somewhere (not counting remote sessions). Thanks to zsh I can share every command I enter…
REPORTTIME is a nifty feature of zsh . If you set it to a non-negative value, then every time, any command you run that takes longer than the value you set it to in seconds, zsh will print usage statistics afterwards as if you had run the command prefixed with time . So, for example, if we run rake to rebuild any out of date files in Rubinius, we get this: ~/Development/Rubinius ☺ » rake [ … Lots…
PostgreSQL supports custom enum types, which is awesome. However, extending them is kind of a pain, since there is no command to just add a new value to the enum. Thanks to this StackOverflow answer , there are two alternate ways to still get what you want. One works by modifying the pg_enum , which strikes me as a bit of a bad idea, since those tables are under Postgres’ direct control. The other…
Note: A german translation is available here This post is based on a talk I gave at the 18th Cocoaheads Meetup Vienna (CHW018) on Feb 17th, 2011. It is an annotated tour of my Git config, Git related scripts and commands, and various other tips and tricks I picked up over the years. You can find most of these things in my dotfiles repo, as well with a lot of other stuff, like parts of my Zsh…