Skip to content

Instantly share code, notes, and snippets.

View grantmcconnaughey's full-sized avatar

Grant McConnaughey grantmcconnaughey

View GitHub Profile
@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.
@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
@grantmcconnaughey
grantmcconnaughey / pdf.py
Last active February 8, 2021 21:50 — forked from zyegfryed/pdf.py
Outputting PDFs with Django 1.8 and FDFgen
# -*- coding: utf-8 -*-
import codecs
import subprocess
from fdfgen import forge_fdf
from django.core.exceptions import ImproperlyConfigured
from django.template import engines
from django.template.backends.base import BaseEngine
from django.template.engine import Engine, _dirs_undefined
- uses: grantmcconnaughey/lintly-flake8-github-action@v1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
failIf: any
args: "--ignore=E121,E123 ."
@grantmcconnaughey
grantmcconnaughey / gvm-check.sh
Last active May 2, 2019 19:42
A Bash script that informs you when a Grails version is available on GVM
#!/bin/bash
# Usage:
# ./gvm-check.sh grails_version
[[ -s "$HOME/.gvm/bin/gvm-init.sh" ]] && source "$HOME/.gvm/bin/gvm-init.sh"
CHECK=""
GRAILS_VERSION=$1
while [ true ]; do
# 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)
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)
<a href="{% url "project:add_projects" service %}" class="btn btn-primary">
<em class="icon-plus"></em> Add Projects
</a>
# Future git services will go here
GITHUB = 'gh'
DUMMY = 'dummy'
def service(request):
services = (GITHUB, DUMMY)
the_service = None
for _service in services:
if request.path.startswith('/{}/'.format(_service)):
the_service = _service
<a href="{% url "project:add_projects" "gh" %}" class="btn btn-primary">
<em class="icon-plus"></em> Add Projects
</a>