Skip to content

Instantly share code, notes, and snippets.

@Cphoenix
Cphoenix / class14.py
Last active March 6, 2017 10:39
Python Class Inheritance Example
# This is a responding to a YouTube comment asking what was wrong with their code.
#!/usr/bin/python
# No imports required
# Two blank lines before class definitions, capitalize name
# Also in Python 2 you need to explicitly inherit from object to use
# the fullname.setter decorator;
# in Python 3 your original class def would have done so automatically
class Employee(object):
@Cphoenix
Cphoenix / netkan-snippets.cson
Last active July 17, 2016 09:49
Atom Snippets for NetKAN Files
'.source.json':
'netkan-SD':
'prefix': 'nkSpaceDock'
'body': """{\n\t"spec_version" : "${1:v1.4}",\n\t"identifier" : "${2:<identifier>}",
\t"$kref" : "#/ckan/spacedock/${3:<sdid>}",\n\t"x_netkan_license_ok" : true,\n\t$6\n}$0"""
'netkan-GitHub':
'prefix': 'nkGitHub'
'body': """{
\t"spec_version" : "${1:1.4}",
\t"identifier" : "${2:<identifier>}",