There is a little tool in OS X called opendiff. This command can be used to bring up a quick and dirty graphical view of changes in a file. For example, if you run opendiff followed by two file names, you’ll see what’s different in the two files and what’s the same:
opendiff test test1
The result then looks as follows.
Note that in the above screenshot, a and b are in white lines and the others are grey, as those are consistent in the two files and the c has been removed and replaced with the four lines on the left. In larger files, this is pretty useful as it provides quick insight into what is different between two files, like what changed in a script between two different versions.
krypted August 27th, 2016
Posted In: Mac OS X, Mac OS X Server, Programming
built-in, changes, MAC, programmatically, scripts, track changes between files
Emacs (not eMacs) is an open source project, bundled with every version of OS X. And it can’t be altered. I wrote about the Cookies recipe
that Richard Stallman bundled with Emacs long ago. He also has some somewhat sexist dating tips and a bunch of other weird rantings that he bundled in there. But perhaps the best contribution is the games that Emacs comes with. These include doctor, dunnet (which would have been a great MMPORG), pong, snake, solitaire, tetris and the ever-so-popular gomoku.
These games are located in the /usr/share/emacs/22.1/lisp/play directory. But you don’t access the games directly. Instead, you use the emacs command. To get started, fire up Terminal, then run the emacs command:
At the “Welcome to GNU Emacs” screen (see below), you’re going to need to be very specific about the keys you use. Hit the Escape key.
At the screen with the red text (see below), hit the x key.
At the M-x prompt, type the name of the game I listed above that you’d like to play.
Here, we’ll type snake.
Press the Enter key and then you will be in the game.
When it’s over, hit escape, then x and then type the name of the next game if you’d like to, such as tetris.
krypted August 20th, 2015
Posted In: Mac OS X
Apple, built-in, emacs, games, gnu, MAC, os x, pong, tetris
The Calculator application in Mac OS X is pretty handy beyond the basic 10-key functions that most people use. As with many things from Apple you can make things much more complicated than the easy to use, basic screens that Apple provides. For example, did you know that Calculator can perform binary, hexadecimal, ASCII and Unicode conversions? To do so, click on the View menu and select Programmer (or use Command-3 to open the view. You can also stop carrying around that old TI-85 you’ve been using for years (to some degree) to calculate those random tangents from time to time.
One of the best parts of Calculator is that you can then access the tape function, which will show you a history of all of your calculations. I use this option all the time, for pasting how I came across various numbers into documents rather than retyping. To use it, simply run the calculations you need and then select Show Paper Tape from the Window menu (you can also use Command-T to access the tape).
Another feature of the Calculator.app that often goes unnoticed is the ability to Convert one unit to another. This includes Area, Length, Power, Pressure, Speed, Volume, Time, Temperature and Weight. But Calculator can also convert currency, which will update automagically when you open Calculator, making it all you need to know how many rupees you should get per dollar!
One thing that I’ve tinkered around with in the past is fully branding the Calculator application. All of the buttons are stored in files nested inside the Calculator.app bundle, giving you the ability to change them to suit your needs. This is pretty cool when used alongside kiosk mode. Although a Mac is a pretty darn expensive dedicated calculator, it can make for a fairly flashy NetBoot image when done right.
Overall, Calculator is one of the more underestimated and underutilized software packages available for Mac OS X. It is versatile and fast, it can show you the history of commands and perform a wide variety of conversions. So if you haven’t had a chance to play with the Calculator then give it a whirl! Oh, and did I mention that Calculator can speak results for you!?!?
krypted January 10th, 2007
Posted In: Mac OS X
accounting, binary, built-in, calculator, conversions, cosin, currency, hexadecimal conversion, Mac OS X, paper tape, pressure, show history, sin, speed, tangent