Skip to content

Instantly share code, notes, and snippets.

View svvitale's full-sized avatar

Scott Vitale svvitale

View GitHub Profile
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('spigot', '0034_hydrated_connection_view_v2'),
@svvitale
svvitale / ca.md
Created January 4, 2018 16:06 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@svvitale
svvitale / Example.cs
Created January 23, 2018 16:55
Dymo SDK Concurrency Issues
using DYMO.Label.Framework;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Printers printers = new Printers();
@svvitale
svvitale / README.md
Last active May 1, 2020 16:22
Vitale's Python Style Guide

Operator Overrides

I absolutely love using operator overrides in low-level objects because it can make the caller's use case WAY more intuitive. There are certainly some pitfalls though.

  1. If you're overriding __getitem__ and __setitem__ to make an object more dictionary-like, make sure to also override __iter__ OR __contains__ since they're called to handle membership tests like in and not in. (ref: https://docs.python.org/3/reference/expressions.html#membership-test-operations)

Enums

Enums can be a little tedious in Python, but there are a few things I try to do to streamline usage:

Keybase proof

I hereby claim:

  • I am svvitale on github.
  • I am svvitale (https://keybase.io/svvitale) on keybase.
  • I have a public key ASDTmkxAdl96XWG71bZe4C58UsDKQXlt8DaltryKd8ALYAo

To claim this, I am signing this object: