Skip to content

Instantly share code, notes, and snippets.

View grantmcconnaughey's full-sized avatar

Grant McConnaughey grantmcconnaughey

View GitHub Profile
def get_projects(self):
client = Github(self.access_token)
owner_logins = set(org.login for org in client.get_user().get_orgs())
owner_logins.add(self.username)
return Project.objects.filter(owner__login__in=owner_logins)
# This dict lives in its own file
git_clients = {
GITHUB: GitHubBackend,
DUMMY: DummyGitBackend
}
def get_projects(self, service):
# Dynamic based on the service
GitBackend = git_clients[service]
git_client = GitBackend(user=self)
@grantmcconnaughey
grantmcconnaughey / views.py
Last active August 23, 2022 07:52
Handling GitHub webhooks with Django
import hashlib
import hmac
import httplib
import json
from django.conf import settings
from django.http import HttpResponse, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
- uses: grantmcconnaughey/lintly-flake8-github-action@v1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
failIf: any
args: "--ignore=E121,E123 ."
@grantmcconnaughey
grantmcconnaughey / repeal-section-174.md
Created March 17, 2023 20:04
Letter to Senator to request the repeal of Section 174

Dear Senator [Last name],

As a concerned constituent, I urge you to support the repeal of Section 174 of the Internal Revenue Code, “Amortization of research and experimental expenditures.” This provision significantly increases taxes for small software businesses like mine, threatening our growth, innovation, and competitiveness.

The repeal of Section 174 is crucial for the following reasons:

  • Innovation: Increased taxes hinder small businesses’ ability to invest in research and development, stifling innovation.
  • Job loss: Small software businesses drive job creation. The tax increase may force downsizing, leading to job losses.
  • Fairness: The tax increase disproportionately affects small businesses, putting them at a disadvantage compared to larger corporations who can afford to pay the increased taxes.