Display Hidden (dotfiles) in OS X Finder

Showing hidden dotfiles in Finder

Showing hidden dotfiles in Finder

By default, files beginning with a dot (like the .DS_Store file prevalent in nearly every OS X directory* see note below on the awesome Asepsis) are hidden in OS X’ Finder. To enable this, use the following steps:

  1. Open Terminal found in Finder > Applications > Utilities. (or use spotlight CMD+space > Terminal
  2. In Terminal, paste the following:

    defaults write com.apple.finder AppleShowAllFiles TRUE

  3. Press enter
  4. Now you need to reload Finder. I personally just type killall Finder in terminal and let Finder restart itself. An alternative is to hold alt (option) on your keyboard, then right click on the Finder icon in the dock and click Relaunch to restart Finder. Now you should be able to see dotfiles such as .DS_Store, .htaccess or .vimrc in Finder.
  5. To revert/disable this behavior, simply run the same command in the console passing TRUE instead of FALSE:

    defaults write com.apple.finder AppleShowAllFiles FALSE

Used this post as reference for this post. Contains more details and a shell alias to toggle hidden files on/off

Note that you may substitute TRUE/FALSE with YES/NO in the above commands.

* To avoid having .DS_Store contaminating your entire OS X folder structure, I recommend highly Asepsis.

Live Markdown Preview in Any Editor Using Marko.app

markdown mou.app alternative marko os x live preview vim webstorm

Marko (free) from the App Store (unrelated to an app with the same name by Marko Labs) finally fulfilled all my requirements to replace my previous Markdown editor Mou. Unlike Mou which tries to do too much and essentially is not meant to be integrated into other apps, Marko does one thing and does it well. It has excellent GitHub flavored Markdown support and it works by simply watching a Markdown file for changes you make in any external editor (my favorites are vim and WebStorm.)

Usage

Open Marko.app, then the markdown. You will see the parsed preview. Now in your editor open that markdown file and edit while Marko sits and updates live.

Command-line Usage

open -a /Applications/Marko.app ~/project/README.md

I created a console script /usr/local/bin/marko

  • Simply create that file: touch /usr/local/bin/marko
  • Give it executable permission: chmod a+x /usr/local/bin/marko
    and paste:
#!/bin/bash
open -n -a /Applications/Marko.app "$@"


(the -n here is to open a new syntax even if one exists. just a personal preference.)

Integration into JetBrains’ suite of apps

To add Marko as an External Tool to WebStorm, open preferences in WebStorm or the other JetBrain IDEs (PHPStorm, RubyMine, etc.) and under External Tools, add it with these options:

  • External Tool to execute: open
  • with the following args: -n -a /Applications/Marko.app $FilePath$

Screenshot makes this easier to understand:

markdown mou.app alternative marko os x live preview vim webstorm

To simplify this, you can create a marko script (see above) and use that in place of “open” in the external tool option and pass $FilePath$ as the argument.

Search file contents with ag—Silver Searcher, Faster than ack and grep

If you use ack or grep to search within files, check out The Silver Searcher (ag).

Installation is easy with homebrew. Open up a terminal and hit:

brew update && brew upgrade

if you haven’t updated in awhile, then to install ag:

brew install the_silver_searcher

when it’s done, type ag -h to see the options. Usage is very similar to ack/grep.

Example, let’s search every app in /Applications for curse words:

ag --stats --all-text --hidden --stats --column --context=0 -i "[^a-z]+?(asshole|whore|slut|cock|douche|faggot|fuck|shit)[^-a-z]" /Applications

outputs..


  $ ...  

  REAPER64.app/Contents/InstallFiles/Effects/LOSER/masterLimiter
   59:77:// Prevent From Preopening, I Know There Might Be Transients In Between, But Fuck'Em :/

  REAPER64.app/Contents/InstallFiles/Effects/Utility/KanakaMS5
   20:63:// so realistically this happens once or when the user changes shit.

  REAPER64.app/Contents/InstallFiles/Effects/Utility/KanakaMSEncoder1
   16:63:// so realistically this happens once or when the user changes shit.

  RubyMine.app/rb/testing/patch/bdd/teamcity/spec/runner/formatter/teamcity/formatter.rb
   435:19:            # Holy shit!!! ----> in ruby 1.8.x "instance_methods" returns collection of string and in   1.9.x collection of symbols!

  Steam.app/Contents/MacOS/tenfoot/resource/localization/tenfoot_swedish.txt
   661:36:"Checkout_Sentiment_OverOut"	"Klart slut"

  Vagrant/embedded/lib/ruby/1.9.1/rubygems/indexer.rb
   350:15:        # HACK: fuck this shit - borks all tests that use pl1

  30 matches
  23210 files searched
  229088848 bytes searched
  34.794926 seconds
$

Running IETester on Mac OS X (Convert EXE to DMG)

Wineskin creates a “wrapper” around a Windows executable file. This wrapper encloses the executable into a specific environment. The .app file (wrapper) simply executes the EXE using `wine`

This example was tested on Mac OS X Lion 10.8.4 and Wineskin Winery 1.7

Testing IE on Mac without installing Windows or using Bootcamp of Parallel.

Download Wineskin Winery, download IETester.exe Install Wineskin Winery (and an engine for it. More details to come, this is WIP)

Create a Winery wrapper and give it a name like IETester.app (If it demands a file, give it IETester.exe)

Screen Shot 2013-08-27 at 2.27.59 PM

 

When the wrapper is done, open the app file and choose “Install software” and from there, find the IETester.exe you had downloaded earlier.

Screen Shot 2013-08-27 at 2.37.19 PM

 

After the installation, Winery will let you know where the IETester.app was generated. In my case, it was in ~/Applications/Wineskin/

Screen Shot 2013-08-27 at 2.34.48 PM

Screen Shot 2013-08-27 at 2.36.21 PM

Now you can run any EXE within the installed app, see picture below.

Testing IE7, IE8, IE9, IE10 on OS X without having Windows

 

If you’re very interested in getting a piece of Windows-only software to run on Mac OS X, consider CrossOver Office, wine itself and many others available.

Learn and Begin Using Markdown in 30 Minutes

Markdown, RedCarpet, Markup Language, OS X, Kramdown, Markdown Editor, Viewer, md file, mkd file, .markdown file

Markdown is a very useful tool for note takers, list makers, writers, bloggers, content architects, developers, … Markdown is essentially a common dialect for note taking. It is very close to how most of us take notes of any kind. Applying a standardized format to your static plain text content means your otherwise arbitrary notes, todo lists and essays are now formatted in a ‘markup’ language that is widely adopted and very simple to pick up and begin using right away. This means that machines now recognize elements of your content and can apply styling and other useful features.

Markdown essentially  s l i c e s  a document into a theme or presentation + the actual content. This means that you write your notes exactly the same way, whether you want a concise and structured grocery list or set of tasks for the week, or you’re writing a book that you want to release in 1 or more formats. Your single essay can be put through 3rd party software and automagically rendered as:

  • Printer-friendly HTML readable in any web browser

  • PDF file for distribution and instant accessibility to PDFs are supported

  • .epub or .mobi ebook file for reading on a Kindle or Nook

  • or published as a hardcopy book

Let’s get practical. You’re making a todo list and realize you need to make another section to group very urgent tasks. You want the urgent tasks to stand out, so you add markings and symbols in your writing to convey labeled groups of tasks. In a text document, you may add 2 empty lines to separate a group and put a line (—–) between a group name and it’s items. Done.

It’s simple. It’s plain text—readable by humans because it looks familiar to how most of us “mark up” our notes by indenting, emphasizing, underline something and using * to denote bullets prefixed to items in a list. And it’s readable by software that can now index, make searchable, add styling and accessibility features (i.e., the file is in a common machine language. I can turn it into a .mobi file to read on my Kindle, or to turn it into an audiobook that has features only possible if you can tell which unit of the file is the title and which is the body of text (like, make an audio Table of Contents.)

UPDATE 12/19/2014: I now use Marko.app over Mou. See my post on Marko and WebStorm integration.

 

Markdown, RedCarpet, Markup Language, OS X, Kramdown, Markdown Editor, Viewer, md file, mkd file, .markdown file

Install Mou – The app features a split screen. The left is where you enter your content, and the right is a live preview of your Markup/HTML content styled using one of the themes in the preferences panel. GitHub, Clearness, Tomorrow, Tomorrow+ and other CSS themes are included. While editing, hit command + R to pull up a concise Markdown Language Syntax reference.

Jeff Atwood describes Markdown accurately:

Markdown is a simple little humane markup language based on time-tested plain text conventions from the last 40 years of computing.

Markdown, RedCarpet, Markup Language, OS X, Kramdown, Markdown Editor, Viewer, md file, mkd file, .markdown file

Mou is a free Mac OS X Markdown Viewer and Editor

Install Behat BDD for PHP on OS X Without php.ini

This is how to install the PHP BDD Behat library. It avoids the “detect_Unicode = false” error you might have when attempting to install it using the phar method.

Open a terminal (spotlight > terminal) and at the cursor of the window that pops up,
type:


$ curl -s https://getcomposer.org/installer | php -d detect_unicode=Off
$ php composer.phar install
$ mkdir app
$ cd app

$ # Now open a file (in any text editor or "nano composer.json" in the terminal. Paste the
$ # following and save the file as composer.json.

{
    "require": {
        "behat/behat": "2.4.*@stable"
    },
    "minimum-stability": "dev",
    "config": {
        "bin-dir": "bin/"
    }
}

$ behat --init
$ touch feature/app.feature

Then follow along: http://docs.behat.org/quick_intro.html#basic-usage