Skip to content

Instantly share code, notes, and snippets.

View codingjoe's full-sized avatar
🫡
helldiving

Johannes Maron codingjoe

🫡
helldiving
View GitHub Profile
@codingjoe
codingjoe / dev-db.yml
Last active January 31, 2024 09:55
Sanaitize a development database via GitHub actions & Heroku
name: Development DB
on:
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
jobs:
dev-db:
services:
@codingjoe
codingjoe / Code.gs
Last active September 23, 2022 12:44
Export GitHub Project Board to Google Sheets
function updateData () {
/* Fetch project cards from GitHub project and insert into Google Sheet. */
const scriptProperties = PropertiesService.getScriptProperties()
const spreadsheet = SpreadsheetApp.getActive()
const sheetName = scriptProperties.getProperty('SHEET_NAME')
const sheet = spreadsheet.getSheetByName(sheetName)
const githubApiUrl = 'https://api.github.com/graphql'
const githubAccessToken = scriptProperties.getProperty('GITHUB_ACCESS_TOKEN')
const githubOrg = scriptProperties.getProperty('GITHUB_ORG')
@codingjoe
codingjoe / geodjango_macOS_arm64.md
Created March 11, 2021 10:29
HowTo run GeoDjango and PostGIS on M1 macOS arm64 MacBook
  1. Install PostgreSQL with PostGIS via Postges.app
  2. Install brew as recommended.
  3. Install dependencies:
    brew install geos gdal
    
  4. Add the following to your settings:
    # settings.py
    

GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH')

@codingjoe
codingjoe / Procfile
Created January 19, 2021 17:29
Sentry Release on Heroku w/ commits, sourmaps & assets
release: bin/release
web: ...
worker: ...
diff --git a/django/core/checks/security/base.py b/django/core/checks/security/base.py
index c21725518b..ecd5f5e004 100644
--- a/django/core/checks/security/base.py
+++ b/django/core/checks/security/base.py
@@ -4,6 +4,8 @@ from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from .. import Error, Tags, Warning, register
+from ...cache import caches
+from ...cache.backends.filebased import FileBasedCache
@codingjoe
codingjoe / compress-background-video.sh
Last active July 13, 2020 11:49
HTML background Video
#!/usr/bin/env sh
set -exo pipefail
# Usage: ./compress-video.sh input-video.mp4 [output-filename-no-ext] [bitrate]
echo "Encode AV1..."
ffmpeg -hide_banner -i "$1" -pass 1 -c:v libaom-av1 -cpu-used 4 -strict experimental -tile-columns 3 -b:v "${3:-"1.3M"}" -threads 8 -auto-alt-ref 1 -lag-in-frames 25 -g 128 -pix_fmt yuv420p -an -sn -y -f webm /dev/null && \
ffmpeg -hide_banner -i "$1" -pass 2 -c:v libaom-av1 -cpu-used 4 -strict experimental -tile-columns 3 -b:v "${3:-"1.3M"}" -threads 8 -auto-alt-ref 1 -lag-in-frames 25 -g 128 -pix_fmt yuv420p -an -sn -y -f webm "${2:-voiio-login-bg}.av1.webm"
From a7e3b566f5cfdc8a8685cb38e3709c46c42fcb9d Mon Sep 17 00:00:00 2001
From: Johannes Hoppe <[email protected]>
Date: Thu, 31 Oct 2019 14:20:25 +0900
Subject: [PATCH] Review suggestions
---
django/contrib/admin/static/admin/js/autocomplete.js | 3 ++-
django/contrib/admin/views/autocomplete.py | 9 +++------
django/contrib/admin/widgets.py | 10 +++++-----
tests/admin_views/test_autocomplete_view.py | 2 +-

Hi Jose, that is a very good question. Many people tend to make the discussion about durability or performance, when in fact most people don't have performance issues. I believe if you want to figure out, what database to use, you need to first figure out what our application's requirements are. If you are building a browser based application that is running locally and you don't need anything but integers, floats and chars. Go with SQLite. If you run a more sophisticated application, maybe follow a SOA based architecture or want to use JSON, UUID, HStore or Arrays; different indices, stemming and database triggers; not to forget PostGIS. Use PostgreSQL. If you have a BI team that needs to build ETL processes, definitely use PostgreSQL.

Bottom line, if you need a simple structured ACID conform data store, use SQLite. If you need a database with plenty features and umpf, use PostgreSQL. BUT ultimately it comes down to what you are most comfortable with. I have been using PostgreSQL for almost a decade and am

@codingjoe
codingjoe / Makefile
Created May 16, 2018 08:32
compile gettext PO files
MSGLANGS = $(wildcard */locale/*/LC_MESSAGES/*.po)
MSGOBJS = $(MSGLANGS:.po=.mo)
gettext: $(MSGOBJS)
gettext-clean:
-rm ${MSGOBJS}
%.mo: %.po
msgfmt -c -o $@ $*.po
diff --git a/package.json b/package.json
index af301ee..f452451 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "heroku-connect-plugin",
"description": "Heroku Connect plugin for Heroku CLI",
- "version": "0.5.0",
+ "version": "0.6.0",