CSS Triangle

There are many resources out there about how to make a CSS triangle, so I’ll just keep this brief and reference the one I used.

Basically, its just a box with height and width of zero, and we use the border to create the triangle. If we use the below code, we will create a box made from four triangles (one from each border).

.arrow-right {
  width: 0px;
  height: 0px;
  border-top: 60px solid black;
  border-bottom: 60px solid black;
  border-left: 60px solid green;
  border-right: 60px solid blue;
}

This creates this shape:
Screen Shot 2015-03-27 at 7.40.05 AM

Now to just make a single triangle, we make three of them transpara

.arrow-right {
  width: 0; 
  height: 0; 
  border-top: 60px solid transparent;
  border-bottom: 60px solid transparent;
  border-left: 60px solid green;
  border-right: 60px solid transparent;
}

which makes:

Screen Shot 2015-03-27 at 7.43.38 AM

Now we can remove the borders that are transparent, but it will change the shape of the triangle. You can play around by removing various borders and see if you like the shape of the triangle. Also, playing with the size or number of pixels in all four sides of the border will adjust the shape of the triangle.

Credit here.

Open URLs and Applications from Terminal and Ruby Scripts

Did you know you can open applications directly from the command line in Terminal?  The command is open

To open a url in the browser from the command line, use

open http://www.apple.com/

You don’t need quotes around the url. This will use the default browser on your machine.

The line

open /Applications/

will open the Applications folder in Finder.

To open a specific application, use the path to that application followed by the .app extension.

open /Applications/Airdroid.app

(Airdroid is a great application for transmitting files from your computer to phone wirelessly.)
If you want to open Sublime Text from the terminal, you can use the command subl

subl .

Will open the current directory in Sublime Text.

If you’re writing a ruby script, use these commands instead:

system("open", "http://stackoverflow.com/")
system("open", "/Applications/Adobe\ Illustrator\ CS6/Adobe\ Illustrator.app")

credit here