Brackets – My New Favorite Code Editor

bracketsA couple of months ago I started searching for “the best” code editor for web development. I wanted to see what was out there and how it compared to what I have used and was currently using.

Since most of my co-workers live in the .NET world I have access to Visual Studio, which I actually like as an IDE. I’ve used it to do a good deal of development over the last couple of years. But I wanted to explore more of what was out there for code editors that might be more lightweight, fun and available wherever I might want to use it (work, home, on the road…).

For web and desktop work at home I’ve used Notepad, Notepad ++ and Aptana and have never been really happy.

Notepad ++ actually works really well but I hate the interface (it’s boring and ugly rolled into one). Besides, it would be nice to use something platform independent for portability. On the plus side (sorry), in Notepad ++ you can configure styles and keyboard mappings and there;s a lot you can do with the preferences to make things work the way you want them to.

That’s actually the story with the majority of editors and IDEs out there today. Most of them have customizable settings and functionality either built-in or available through plug-ins or extensions. Some of them are geared toward specific languages or uses but most of them seem to handle the most common languages.

No Magic Bullet

I’ve come to the conclusion that there is no “best” editor. There are only ones with fewer annoyances than others. Out of the editors I have been trying lately there are a few I have only used for a few seconds (like Atom) and some I’ve done some heavy lifting with (like Sublime Text). My favorite so far has been Brackets, the open source project from Adobe.

Brackets

I really like the look and feel of Brackets. It has a nice flat design. It doesn’t overwhelm you with controls and menus. But that led me to pause and question – where are all the controls and menus? It turns out, a lot of your customizations are done directly through json files or through extensions. That’s great because I love working in json.

Changing the keymap is not as straight-forward as most code editors and IDEs but it is intuitive and simple. You just have to override the default mappings in the keymap.json file. I set up my block and single line mappings because the defaults almost always annoy me.

I’ve been using Brackets both at work and at home. In my home setup I use the live preview feature all the time. It’s only available through Chrome which is not a problem for me. I usually like to debug my HTML, JavaScript and CSS in Firefox (Firebug) but the Chrome developer tools work just fine for most things. Live preview is great because the Chrome page refreshes automatically every time you save your HTML file. I have a different setup at work which doesn’t allow for the live preview to work but I might be changing that soon.

Brackets really shines with its extensions manager. This is where you can install/uninstall user created extensions or Brackets themes. You can also search Github for extension, download the zip file and drag the zip right into the extension manager. It only took a few minutes to search for and install a few extensions to make development easier. These included Grunt, indent guides, code folding and code beautification(formatting).

I have notices some of the extensions can slow Brackets way down so that’s something to watch as you’re loading new ones up. Now I’m just looking for a reason to create an extension of my own or some reason to hack Brackets itself.

Shapefile as a Multi User Editing Environment?

I had a ArcGIS user that I support come to me with a corrupted shapefile the other day. It had the old “number of shapes does not match number of table records” error. It turns out, he’s still using this shapefile as his layer’s main data source and he and several others regularly edit it! In this day and age?120px-Face-surprise.svg

I tried to convince him using a file geodatabase would be more stable for editing but he had been using shapefiles so long I don’t even think my comments registered. He just wanted a tool that could fix the shapefile.

I pointed him to the shapechk tool by Andrew Williamson. I’ve used the tool for years because <sarcasm>for some odd reason</sarcasm> I often run into people with corrupted shapefiles after people edit them over long periods of time. The shapefile works OK as a data exchange format but doesn’t always hold together under regular heavy use.

well duh garfield photo: Well duh Garfield wellduh.jpg

In the words of Pete Seeger, “when will we ever learn?”

Are Linkedin Background Photos Worth the Trouble?

InBug-60px-RWith Linkedin allowing background photos for your profile you now have one more way to express yourself creatively on the platform. But Linkedin isn’t Facebook. It’s a professional network and is typically understood to have professionally presented profiles. Having a clean, flat layout with a simple blue and grayscale color scheme has helped keep Linkedin profiles in line with that strategy.

Before background photos the worst offense a user could do visually was insert Homer Simpson as their profile picture. Now we are given the power to screw up a much larger portion of our profile’s real estate.

Is it worth possibly reducing the professional look of your profile just to “express” yourself on one more social channel? Or is it worth the time and effort it will take to produce an image that will still project the professionalism that a plain background already does? The answer to both of these questions is – probably not. I doubt that a connection, employer or recruiter will give a second thought to your profile header not having some sort of graphic behind it. A good head shot as your profile picture will, however, still be expected.

But that doesn’t mean that you absolutely shouldn’t use a background photo. If an image is well thought-out and conveys important information upfront to someone viewing your profile, it could be very worthwhile. Putting in a picture of balloons, sunsets or your dog will probably only serve to distract viewers. However, a picture of you speaking at an event gives the impression that you’re an expert in your field and have experience with public speaking. Likewise, a picture of a map might strengthen the profile of a cartographer or GIS professional.

When someone views your profile, your title and profile picture are usually the first things they see. As we all know, first impressions can make a real impact. If you can influence that first impression positively, then the extra profile eye-candy could be an asset.

I’m still on the fence about whether to put a background photo on my own Linkedin profile page. At this point in time I think Linkedin background photos are a bit of a risk for both Linkedin and its users. While profile customization can make your page look nice, it also runs the risk of making it look like a wannabe Facebook page. That’s not in keeping with the feel of Linkedin. If you do decide to add a background photo, keep it simple and above all, relevant to the rest of your profile.

C is for Crash

There are those moments when you realize that certain sports just aren’t worth it.

c is for crash_cropped

I spotted this sign while hiking a local ski resort in the off season. I wonder how long it took for someone to realize that instilling terror in your patrons isn’t a good marketing ploy.

Installing Setuptools and PIP for Python

python-logo-master-v3-TM-flattenedI’ve installed a lot of Python packages over the years using Distutils, SetupTools/easy_install and PIP. Distutils is Python’s built-in package distribution module and is pretty easy to use. However, it has some limitations, primarily that you have to manually download the package dependencies and there is no method to uninstall packages.

The Setuptools easy_install script takes care of downloading packages and package dependencies but still lacks certain features you would want from a fully functioning package manager. It doesn’t provide version control support, package tracking and uninstallation. There is a lot more to the Python package discussion but there is no point in bringing it up.

Anyway, while I use package distribution tools I rarely have to install the tools themselves since they only get loaded once. When I do have to set up a new machine or upgrade someone elses, I always forget the steps to get Setuptools and PIP installed. So I thought I would document the steps here. Now I just have to remember to come back here when I need them.

 Installing Setuptools:

1. Right click on this ez_setup.py link and save the file to your Python Scripts folder (If you have ArcGIS loaded you will usually find this at C:\Python27\ArcGIS10.x\Scripts).

2. Open a command prompt and change into the SCRIPTS directory.

3. Type

then hit enter to execute the code. This will run the script which will download and install setuptools on your system.

For the official installation instructions for setuptools, which includes instructions for installing on Windows 8 with Powershell visit https://pypi.python.org/pypi/setuptools.

Installing PIP:

1. Open a command prompt and change into the C:\Python27 directory.

2. Type

then hit enter to execute. Pip should now be installed on your system.

To actually install a package using PIP from a command prompt you simply type

and everything will be taken care of for you. To explore the more than 54,000 packages that are available for Pip to load visit PyPI – the Python Package Index.

Be Different with Custom Styled Google Maps


map style by Tracy Elliott on SnazzyMaps.com

If you are developing with the Google Maps JavaScript API you’re already creating custom code so you might as well go the extra mile and change the default style of your map so it doesn’t look like every other Google map out there.

Getting a unique looking map that fits well with the style of your web page is actually really very easy. The Google API gives you the option of re-styling the existing standard map types or creating new map types containing your styles. Either way, if you are comfortable with the Google Maps JavaScript API you can put a fresh face on your map in no time.

For detailed instructions on how to custom style your map, you can see the Styled Maps section of the Google Map JavaScript API Developer’s guide.

If you would rather use a tool to generate your code you can use the ones listed below for free. Some of them even have pre-built styles that are ready to be plugged into your code.

Styled Map Wizard

Evoluted Style Tool

MapStylr

SnazzyMaps

Google Maps Colorizr

Custom Google Maps Style Tool

 

Tourist Pine to Fly Drones in Antarctica? Weird!

 antarctica

The International Association of Antarctica Tour Operators is cautioning all potential travelers to Antarctica who pine to fly a drone to check with their travel agent or tour operator before packing their device.  – The Washington Times

Tourists are pining to fly drones in Antarctica? What kind of tourist pines to fly drones in Antarctica? The bigger question is who uses the word pining anymore?

Is IE on its Last Legs?

2000px-Internet_Explorer_10_logo.svg

Tidings of a new browser coming from Microsoft have some wondering whether Internet Explorer is on its last legs. The sad news is that there are still so many old  versions (7, 8 and 9) IE sitting on millions of computers, and their users don’t know any better. So even if Spartan, or its children, eventually displace IE, front-end developers will be playing pattycake with old IE versions for years to come.

It’s interesting that Microsoft is coming out with a brand new browser when IE11 has so many improvements and seems much less maligned than its older versions. Makes me think maybe this is just the start of a rebranding effort.

 

Further Reading:

http://www.computerworld.com/article/2863746/what-microsofts-fresh-start-browser-strategy-means.html

Map your business

Believe it or not, maps aren’t magical. They don’t just happen. Online mapping companies like Google, Microsoft, Apple and MapQuest get data on their maps through good old fashioned research. But there is a limit to the amount of information they are willing to collect and display by default.

Fortunately, if you’re a business owner you can help make online map applications more complete while increasing your business’ exposure. The four companies listed above all offer free services for verified businesses to be able to update the information presented on their maps.

If you own a business you owe it to yourself to research your own map listings and update them if you don’t like what you see. Here are the links so you can get verified and start updating now:

https://www.google.com/business/

https://mapsconnect.apple.com/

https://www.bingplaces.com/

MapQuest no longer supports accessing your basic listing information through their Local Business Center. You can add your business listing to MapQuest but you can only submit limited information. In order to enhance your listing you need to upgrade to a premium account.

How to Organize Your CSS

Organizing my css styles does not come easily. I like to just throw styles on the page when I need them and then forget about them. If I need to edit the style I can always use a Find or Search function for the id, class or tag name I need.

If you are the only one working on your project you might be able to get away with just using the search function in your IDE. You probably know (generally) where things are because you put them there. But organization is still important.

The real power of organization comes when other people use and modify your css. If anyone other than yourself is going to even look at your stylesheet you have to make if accessible.

There might be a hundred ways to put your stylesheet together in a logical, readable way. Here is one way that works for me:

1. It goes without saying to get your style definitions out of your html document. Putting your styles in a <style> tag really only works for an extremely small project that will never grow. If you want to scale your project, having your html and css in one page gets ugly. As far as inline styles, I only use them occasionally when I am dynamically generating certain elements. I never use inline styles in static html.

2. Use /**/ comments to explain and segment your external stylesheet. At the beginning of the .css file it is convenient to have a comment block that describes how the style rules are organized and the stylesheet’s relationship to other stylesheets, if there are any.

Some developers like to put common block level element (body, header, footer, p, h1 …) styles on a sheet separate from all other css. Others have separate sheets for each type of page on their site. This should be documented at the top of each css file to make style navigation easier.

A lot of my work is done for single page GIS apps so I usually have a single external css page. In these cases I note that this is the only css stylesheet for the app.

3. Everyone has their own favorite way of laying out their styleswithing the stylesheet. Some organize their ids and classes alphabetically while others might order them parallel to their element’s order in the html. I find that it makes most sense to group styles according to sections of the page. Sometimes I put css blocks in order of how the html sections are created but this isn’t always the case. Within each of these sections I try to further order elements from top to bottom as they appear in the html.

There are a lot of ways to organize css and what I outlined above is only one of them. The most important thing is just to have some form of organization and then be consistent in applying it.