One of the things that kept on bothering me when SSH’ing is that the keys of the numpad would not work in vi: when pressing any key on the numpad, another key would be sent somehow.
Should’ve Google’d this a lot earlier because the fix is very simple: in the preferences of Terminal, go to Profiles → Your Profile → Advanced and uncheck the “Allow VT100 application keypad mode” option.
You can also tweak this setting from the CLI using PlistBuddy:
bramus/ansi-php is a set of classes to working with ANSI Control Functions and ANSI Control Sequences (ANSI Escape Sequences) on text based terminals.
ANSI Control Functions control an action such as line spacing, paging, or data flow.
ANSI Control Sequences allow one to clear the screen, move the cursor, set text colors, etc.
When it comes to ANSI Escape Sequences bramus/ansi-php supports SGR (Select Graphic Rendition) and ED (Erase Display)
SGR affords one to manipulate text styling (bold, underline, blink, colors, etc.).
ED allows one to erase the display.
Other Control Sequences – such as moving the cursor – are not (yet) supported.
It differs from other “PHP ANSI Color” attempts by not being limited to SGR only – it can easily be extended to support other ANSI Escape Sequences – and by supporting all SGR parameters.
The library ships with an Ansi helper class to easily use it.
// Create Ansi Instance
$a = new Ansi();
// Output some styled text on screen, along with a Line Feed and a Bell
echo $a->color(array(SGR::COLOR_FG_RED, SGR::COLOR_BG_WHITE))
->text('My text will be white on a red background and I will be blinking.')
->text('I will be normally styled. Oh, a bell is coming up ...')
It’s showtime in a terminal near you! Put on your best colours, resize to 80 columns, and let your fingers fly!
Termshows are purely text based. This makes them ideal for demoing instructions (as the user can copy-paste), making fail-safe “live-coding” sessions (plain text is very scalable), and sharing all your l33t terminal hacks.
Most of the time Finder will show you multiple entries for each application when right clicking a file and choosing Open With. Getting rid of Open With duplicates gives us an alias to remove those duplicates. Below is not only the alias, but a one-line command to add the alias to your ~/.bash_profile. Just copy and paste it onto the shell and you’ll have the fixopenwith alias available.
Above that the version below is a slightly improved version: not only will it rebuild the index, it’ll also relaunch Finder and open TotalFinder (if you have it installed) after having rebuilt the index.
echo "alias fixopenwith2='/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder && open /Applications/TotalFinder.app'" >> ~/.bash_profile
Once done, just call fixopenwith and it’ll do it all automatically.