TroyGrosfield.com TroyGrosfield.com

Headline

JQuery Sorting by Attribute Value

Author
by Troy Grosfield
Date
April 25th, 2014
Category
Developer
Story

Since jquery objects are “array-like” and not actual arrays,  things like “sort” raise a few questions after inspecting jquery code.  As of jquery 2.1.0 you notice that “sort” isn’t a document method and diving into the source, you’ll see that it’s for internal use only: // For internal use only. // Behaves like an Array’s … read more

Tags
Comments
No Comments »
Headline

Making the Move to Python 3: Python3, Virtual Environments and pip

Author
by Troy Grosfield
Date
January 9th, 2014
Category
Developer
Story

I finally made the move to converting all my apps to python 3 and it wasn’t nearly as painful as I was expecting.  One main hurdle was to figure out how to correctly get a virtual environment created with python 3 using the correct version of pip. My initial attempt to create a virtual environment … read more

Tags
Comments
No Comments »
Headline

Code Review Etiquette

Author
by Troy Grosfield
Date
December 9th, 2013
Category
Developer
Story

I always enjoy code reviews because they usually bring up some great teaching points and discussions. With that being said, I always feel compelled to make sure everyone’s on the same page with code reviews. Don’t Take it Personal! First and foremost, don’t take comments personal! Developers are short and to the point with comments … read more

Tags
Comments
No Comments »
Headline

Create a Screenshot Using PhantomJS

Author
by Troy Grosfield
Date
November 27th, 2013
Category
Developer
Story

I found this to be a bit interesting so I thought I would share with others.  My goal was to find a way to automate taking a screenshot of a website.  Below is an example of how to do it in PhantomJS: Install PhantomJS There page pretty much explains everything: http://phantomjs.org/download.html I’m on a Mac … read more

Tags
Comments
No Comments »
Headline

Contributing to Pypi

Author
by Troy Grosfield
Date
November 6th, 2013
Category
Developer
Story

Below will show the steps you need to take to register and upload your app to Pypi, then to create a tag in github for the uploaded version. Register An App in Pypi $ django-awesome-bootstrap git:(master) python setup.py register running register running egg_info writing django_awesome_bootstrap.egg-info/PKG-INFO writing top-level names to django_awesome_bootstrap.egg-info/top_level.txt writing dependency_links to django_awesome_bootstrap.egg-info/dependency_links.txt reading … read more

Tags
Comments
No Comments »
Headline

Python virtualenv and virtualenvwrapper Cheat Sheet

Author
by Troy Grosfield
Date
April 20th, 2013
Category
Developer
Story

Commands for working with virtualenv and virtualenvwrapper. Installation Assuming you already have pip installed: $ sudo pip install -U virtualenv Install virtualenvwrapper $ sudo pip install -U virtualenvwrapper Create virtualenv $ mkvirtualenv <env_name> $ mkvirtualenv my_env Create Virtualenv with a different python My current system python is version 2.7.2.  I want my virtualenv to use … read more

Tags
Comments
No Comments »
Headline

Working with CSS Positions: Creating a Simple Progress Bar

Author
by Troy Grosfield
Date
February 11th, 2013
Category
Developer
Story

Working with CSS positioning can be tricky at times.  There are a few affects that you want to achieve, but aren’t quite sure how.  In the below example, I’ll show you how to create a simple progress bar affect using styles. The affect we’re trying to achieve Styles Give all components a common width: .container, … read more

Tags
Comments
No Comments »
Headline

Git Cheat Sheet

Author
by Troy Grosfield
Date
February 7th, 2013
Category
Developer
Story

Git commands and working with Github. Create a Repository Steps to create a new repository in github. Go to github and log in. In the top right you’ll see an icon to create a repository. Click that link. Enter a repository name. Separate words with dashes (i.e. my-first-repo) Enter a description for what the repository … read more

Tags
Comments
No Comments »
Headline

Generating an SSH Key for Github

Author
by Troy Grosfield
Date
February 7th, 2013
Category
Developer
Story

These are the steps to generate a new ssh key for Github: Open terminal and run the following command: $ ssh-keygen -t rsa you will be prompted to for the location to save the key: Enter file in which to save the key (/Users/USERNAME/.ssh/id_rsa): /Users/USERNAME/.ssh/your_key_name Two key will have been generated at the path you … read more

Tags
Comments
No Comments »
Headline

Naming CSS Classes

Author
by Troy Grosfield
Date
January 3rd, 2013
Category
Developer
Story

There are lots of questions when styling a web page of “what should I name this CSS class”.  Here are a few things to think about as you ponder your decision. Leave implementation logic out of class names!  I’ll use Twitter Bootstrap (which by the way is awesome) as an example.   Sometimes they do … read more

Tags
Comments
No Comments »