TroyGrosfield.com TroyGrosfield.com

Posts Tagged ‘cheat_sheet’

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

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

Unix Command Line Cheat Sheet

Author
by Troy Grosfield
Date
February 24th, 2012
Category
Developer
Story

Here are some unix commands I find useful. Display All Running Processes $ ps aux Limit to only look at celeryd processes: $ ps aux | grep celeryd List Contents of a Directory including Hidden Files/Folders: $ ls -l -a Searching Find all files with some text in the file: find . -exec grep -l … read more

Tags
Comments
1 Comment »
Headline

MongoDB Cheat Sheet

Author
by Troy Grosfield
Date
February 22nd, 2012
Category
Developer
Story

A few commands that help with querying and troubleshooting mongodb. This document assumes we have a database called “test” and we have a collection called “comments”. Commands Number of documents in a collection: $ db.comments.count() 42232 Show the size of the Index: $ db.comments.totalIndexSize(); 73696 Show details of a specific query: $ db.comments.find({ tags : … read more

Tags
Comments
1 Comment »
Headline

Python Cheat Sheet

Author
by Troy Grosfield
Date
October 17th, 2011
Category
Developer
Story

Frequently used methods I use in Python with examples. Date and Datetime Lists and Sets Finding Intersection of 2 Lists Working with Urls Date and Datetime Useful links: http://docs.python.org/library/datetime.html#strftime-and-strptime-behavior http://labix.org/python-dateutil String to Datetime Convert a string into a datetime object. >>> from datetime import datetime >>> datetime.strptime(‘Jun 1 2005  1:33PM’, ‘%b %d %Y %I:%M%p’) datetime.datetime(2005, … read more

Tags
Comments
No Comments »