Skip to content

Instantly share code, notes, and snippets.

View squio's full-sized avatar

Johannes la Poutre squio

View GitHub Profile
@hakib
hakib / admin.py
Last active January 22, 2024 15:18
How to Turn Django Admin Into a Lightweight Dashboard
# https://hakibenita.com/how-to-turn-django-admin-into-a-lightweight-dashboard
from django.contrib import admin
from django.db.models import Count, Sum, Min, Max, DateTimeField
from django.db.models.functions import Trunc
from . import models
def get_next_in_date_hierarchy(request, date_hierarchy):
@LayZeeDK
LayZeeDK / angular-cli-node-js-typescript-rxjs-compatiblity-matrix.csv
Last active March 17, 2024 13:40
Angular CLI, Angular, Node.js, TypeScript, and RxJS version compatibility matrix. Officially part of the Angular documentation as of 2023-04-19 https://angular.io/guide/versions
Angular CLI version Angular version Node.js version TypeScript version RxJS version
~16.0.0 ~16.0.0 ^16.13.0 || ^18.10.0 >=4.9.5 <5.1.0 ^6.5.5 || ^7.4.0
~15.2.0 ~15.2.0 ^14.20.0 || ^16.13.0 || ^18.10.0 >=4.8.4 <5.0.0 ^6.5.5 || ^7.4.0
~15.1.0 ~15.1.0 ^14.20.0 || ^16.13.0 || ^18.10.0 >=4.8.4 <5.0.0 ^6.5.5 || ^7.4.0
~15.0.5 ~15.0.4 ^14.20.0 || ^16.13.0 || ^18.10.0 ~4.8.4 ^6.5.5 || ^7.4.0
~14.3.0 ~14.3.0 ^14.15.0 || ^16.10.0 >=4.6.4 <4.9.0 ^6.5.5 || ^7.4.0
~14.2.0 ~14.2.0 ^14.15.0 || ^16.10.0 >=4.6.4 <4.9.0 ^6.5.5 || ^7.4.0
~14.1.3 ~14.1.3 ^14.15.0 || ^16.10.0 >=4.6.4 <4.8.0 ^6.5.5 || ^7.4.0
~14.0.7 ~14.0.7 ^14.15.0 || ^16.10.0 >=4.6.4 <4.8.0 ^6.5.5 || ^7.4.0
~13.3.0 ~13.3.0 ^12.20.2 || ^14.15.0 || ^16.10.0 >=4.4.4 <4.7.0 ^6.5.5 || ^7.4.0
@TiborUdvari
TiborUdvari / ExcemptFromEncryption.cs
Last active April 23, 2024 16:22
Marks ITSAppUsesNonExemptEncryption in Unity generated Info.plist file to false. Doing this no longer requires manually marking the app as not using non-exempt encryption in iTunes Connect for Testflight beta testing.
using UnityEngine;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor;
using UnityEditor.iOS.Xcode;
using System.IO;
public class ExcemptFromEncryption : IPostprocessBuildWithReport // Will execute after XCode project is built
{
public int callbackOrder { get { return 0; } }
@SteveKennedy
SteveKennedy / removeAdFramework.js
Last active August 1, 2021 13:35
Cordova Hook - Removes Ad Framework From Plugin.XML
// This Cordova Hook (script) removes "AdSupport.framework" and "libAdIdAccess" references
// from the cordova-plugin-google-analytics plugin, as well as removes it from
// references found in the corresponding node_module and .project.pbxproj.
// The authoritive source is found at: https://gist.github.com/SteveKennedy
module.exports = function (ctx) {
console.log("Attempting To Remove Ad (IDFA) References from project....")
var pluginName = 'cordova-plugin-google-analytics';
@sttz
sttz / AndroidKeystoreAuthenticator.cs
Created June 15, 2017 16:16
Unity editor script that stores Android Keystore passwords in the macOS Keychain.
using System;
using System.IO;
using UnityEditor;
using UnityEditor.Build;
using UnityEngine;
#if UNITY_EDITOR_OSX
/// <summary>
/// Unity clears Android Keystore and Key Alias passwords when it exits,
@AnnaDamm
AnnaDamm / forms.py
Last active June 28, 2021 09:26 — forked from eerien/forms.py
Comma Separated Values Form Field for Django. There are CommaSeparatedCharField, CommaSeparatedIntegerField.
from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
class MinLengthValidator(validators.MinLengthValidator):
message = _("Ensure this value has at least %(limit_value)d elements (it has %(show_value)d).")
@jeremyjbowers
jeremyjbowers / actions.py
Created November 24, 2015 21:47
Export to CSV for Django admin
import csv
from django.http import HttpResponse
def export_as_csv_action(description="Export selected objects as CSV file", fields=None, exclude=None, header=True):
"""
This function returns an export csv action
'fields' and 'exclude' work like in django ModelForm
'header' is whether or not to output the column names as the first row
"""
def export_as_csv(modeladmin, request, queryset):
@raldred
raldred / gist:6fb93d969aaede7ffe41
Last active July 29, 2022 16:20
Getting RTL SDR and dump1090 running on OSX El Capitan
# =================================================================================================
# RTL SDR & Dump1090 installation for OSX El Capitan
# =================================================================================================
# This is written as a guide for those wanting to install RTL SDR and Dump1090 for OSX El Capitan
# It may work on other versions of OSX
# I am using a R820T from Jetvision.de
# http://bit.ly/1QynTts - without antenna
# http://bit.ly/1O60IUV - with small indoor antenna
# -------------------------------------------------------------------------------------------------
# To follow this guide you will need to use the Terminal app
@dimitrov
dimitrov / messages.html
Created April 26, 2015 20:30
Bootstrap Alerts for Django
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }} alert-dismissible text-center" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong>{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}Error{% else %}{{ message.tags|title }}{% endif %}!</strong> {{ message }}
</div>
{% endfor %}
{% endif %}

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs