Skip to content

Instantly share code, notes, and snippets.

Avatar

Rob McCormick remccormick

View GitHub Profile
View pep8_cheatsheet.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py
@remccormick
remccormick / profile.ps1
Created Nov 20, 2019 — forked from timsneath/profile.ps1
PowerShell template profile: adds some useful aliases and functions
View profile.ps1
### PowerShell template profile
### Version 1.03 - Tim Sneath <tim@sneath.org>
### From https://gist.github.com/timsneath/19867b12eee7fd5af2ba
###
### This file should be stored in $PROFILE.CurrentUserAllHosts
### If $PROFILE.CurrentUserAllHosts doesn't exist, you can make one with the following:
### PS> New-Item $PROFILE.CurrentUserAllHosts -ItemType File -Force
### This will create the file and the containing subdirectory if it doesn't already
###
### As a reminder, to enable unsigned script execution of local scripts on client Windows,
@remccormick
remccormick / A_Profile_Goco.ps1
Created Nov 20, 2019 — forked from i-e-b/A_Profile_BJSS.ps1
My sample Powershell profile script
View A_Profile_Goco.ps1
Set-PSReadlineOption -BellStyle None
Import-Module 'C:\Gits\posh-git\src\posh-git.psd1'
set-executionpolicy Unrestricted process
$baseDir = Split-Path -parent $MyInvocation.MyCommand.Definition
#. "$baseDir\hand.ps1"
# General actions
function edit ($file) { & "${env:ProgramFiles(x86)}\Notepad++\notepad++.exe" $file }
function vim () { & "${env:ProgramFiles}\Vim\vim80\gvim.exe" $args }
View leave_your_inhibitions_at_the_database.md

The Django ORM

# models.py

from django.db import models

class Pasta(models.Model):
    name = models.CharField(max_length=200)
    price_per_pound = models.DecimalField(decimal_places=2)