Skip to content

Instantly share code, notes, and snippets.

View acquayefrank's full-sized avatar
🏠
Working from home

Frank Acquaye acquayefrank

🏠
Working from home
View GitHub Profile
@acquayefrank
acquayefrank / gist:d459f5ec5fb591cd8664bdcfb8cec108
Last active May 27, 2022 07:44 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@acquayefrank
acquayefrank / git-commit-template.md
Created February 4, 2022 09:07 — forked from lisawolderiksen/git-commit-template.md
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@acquayefrank
acquayefrank / wget.sh
Created December 27, 2020 09:49 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@acquayefrank
acquayefrank / forecasting_metrics.py
Created October 6, 2020 18:05 — forked from bshishov/forecasting_metrics.py
Python Numpy functions for most common forecasting metrics
import numpy as np
EPSILON = 1e-10
def _error(actual: np.ndarray, predicted: np.ndarray):
""" Simple error """
return actual - predicted
layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose

@acquayefrank
acquayefrank / README.md
Created October 8, 2018 10:55 — forked from yardensachs/README.md
Django TestCase assert method for counting executed queries with a specified model.

Specified model Django TestCase assertion

Django TestCase assert method for counting executed queries with a specified model.

Built using example from the django assertNumQueries method.

Usage:

with self.assertModelAndNumQueries([
"""
Logical deletion for Django models. Uses is_void flag
to hide discarded items from queries. Overrides delete
methods to set flag and soft-delete instead of removing
rows from the database.
"""
from django.apps import apps
from django.contrib.admin.utils import NestedObjects
from django.db import models
from django.db.models import signals
class Image(models.Model):
original = models.ImageField(
upload_to='products',
max_length=250,
blank=True,
null=True
)
thumbnail = ImageSpecField(
source='original',
processors=[ResizeToFill(100, 50)],
# You need to install scikit-learn:
# sudo pip install scikit-learn
#
# Dataset: Polarity dataset v2.0
# http://www.cs.cornell.edu/people/pabo/movie-review-data/
#
# Full discussion:
# https://marcobonzanini.wordpress.com/2015/01/19/sentiment-analysis-with-python-and-scikit-learn