Skip to content

Instantly share code, notes, and snippets.

Text Editors, why they're awesome!

{<1>}sublime pic

Better then an IDE

  • Speed
  • Learn once - swiss army knife
  • smaller amount of required screen space
  • Smaller learning curve
  • Easier version control then IDE's
  • Easier to customize
@calumroy
calumroy / PyQuickMac.md
Last active August 29, 2015 14:02
Python Quick Start for Mac

Python Quick Start for Mac

#Homebrew Mac First you need Homebrew installed.

Requirements:

  • OS X 10.5 or higher 2
  • Command Line Tools for Xcode:

###Homebrew Mac First you need Homebrew installed.

Requirements:

  • OS X 10.5 or higher 2
  • Command Line Tools for Xcode:
    xcode-select --install, https://developer.apple.com/downloads
@calumroy
calumroy / Management CommandsDjango.md
Last active August 29, 2015 14:03
Management Commands Django

Creating a Management Command in Django

  • Create a management and commands directory in the Django project
    mkdir management cd management mkdir commands

  • Create the empty init.py nano __init__.py
    cd commands

@calumroy
calumroy / Virtual Envs, Unit Testing, IPython.md
Last active May 19, 2022 07:51
Virtual Envs, Unit Testing, IPython

Python3 virtual env soution

Start virtual python environment.
pipenv shell
Install requirments from a Pipfile
pipenv install

example project
New project "switch-boat" imported from switch-pi
use pipenv to install requirements from PipFile.
I also had to install python 3.7 with pyenv

@calumroy
calumroy / C# Serial reader.md
Last active August 29, 2015 14:05
###C# Serial Reader
@calumroy
calumroy / Django Basics.md
Last active August 29, 2015 14:05
Django basics

##virtual env

workon hpflask

pip install -r path/to/requirements.txt

##manage.py

###Runserver ./manage.py runserver

@calumroy
calumroy / wireshark pyreshark.md
Last active August 29, 2015 14:07
Wireshark pyreshark

Install WireShark Ubuntu from source

Download from https://www.wireshark.org/download.html Extract the files. Do not install yet.

Download the pyreshark source from here

hg clone https://code.google.com/p/pyreshark/  

Copy the files to here (WIRESHARK_DIR)/wireshark-1.12.1/plugins/pyreshark

Install dependancies

You may need to install these dependancies and more;

@calumroy
calumroy / Wireshark Dissectors.md
Created October 3, 2014 05:54
Wireshark Dissectors

Python Profiling Techniques

  • timeit Is useful for quickly testing self contained functions.
import timeit
timeit.timeit('text.find(char)', setup='text = "sample string"; char = "g"')

Can also test class functions but you have to import the class and variables using setup.