Skip to content

Instantly share code, notes, and snippets.

View creimers's full-sized avatar
🏠
Working from a great place

C Reimers creimers

🏠
Working from a great place
View GitHub Profile
# 6. Drop all djangocms_blog tables from the database
Traceback (most recent call last):
File "/srv/.venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 87, in _execute
return self.cursor.execute(sql)
psycopg2.errors.SyntaxError: syntax error at or near "`"
LINE 1: DROP TABLE IF EXISTS `djangocms_blog_authorentriesplugin_aut...
^
The above exception was the direct cause of the following exception:
Applying djangocms_versioning.0017_merge_20230514_1027... OK
Applying taggit.0006_rename_taggeditem_content_type_object_id_taggit_tagg_content_8fc721_idx... OK
/srv/.venv/lib/python3.9/site-packages/djangocms_4_migration/management/commands/migrate_alias_plugins.py:207: UserWarning: No user has been supplied when creating a new AliasContent object. No version could be created. Make sure that the creating code also creates a Version objects or use AliasContent.objects.with_user(user).create(...)
alias_content = AliasContent.objects.create(
Error plugin 436122 Doesn't exist at the position in placeholder 11614
Error plugin 435872 Doesn't exist at the position in placeholder 11614
Error plugin 327392 Doesn't exist at the position in placeholder 12340
Error plugin 434903 Doesn't exist at the position in placeholder 11614
Error plugin 108175 Doesn't exist at the position in placeholder 11948
Error plugin 361833 Doesn't exist at the position in placeholder 12519
Traceback (most recent call last):
File "/srv/.venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "djangocms_versioning_ver_content_type_id_object_i_fac3dca5_uniq"
DETAIL: Key (content_type_id, object_id)=(331, 69) already exists.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
Operations to perform:
Apply all migrations: djangocms_blog
Running migrations:
Applying taggit.0006_rename_taggeditem_content_type_object_id_taggit_tagg_content_8fc721_idx... OK
Applying djangocms_blog.0040_auto_20211128_1503... OK
Applying djangocms_blog.0041_auto_20211214_1137... OK
Applying djangocms_blog.0042_alter_post_enable_comments... OK
Applying djangocms_blog.0043_postcontent... OK
Applying djangocms_blog.0044_copy_plugins...Copying KI und Atomkraft passen gar nicht zusammen (de) to post content...
Traceback (most recent call last):
Applying cms.0033_placeholder_source_data_migration...Info: Skipping None placeholder field 'sidebar_placeholder' on donation.DonationCampaign object 9
Info: Skipping None placeholder field 'header_image_placeholder' on donation.DonationCampaign object 9
Info: Skipping None placeholder field 'sidebar_placeholder' on donation.DonationCampaign object 7
Info: Skipping None placeholder field 'header_image_placeholder' on donation.DonationCampaign object 7
Info: Skipping None placeholder field 'sidebar_placeholder' on donation.DonationCampaign object 11
Info: Skipping None placeholder field 'header_image_placeholder' on donation.DonationCampaign object 11
Info: Skipping None placeholder field 'sidebar_placeholder' on donation.DonationCampaign object 17
Info: Skipping None placeholder field 'header_image_placeholder' on donation.DonationCampaign object 17
Info: Skipping None placeholder field 'sidebar_placeholder' on donation.DonationCampaign object 28
Info: Skipping None placeholder field 'header_image_placeholder
import math
def calculate_transition_length(
radius: float,
ramp_height: float,
table_length: float) -> float:
height_ratio = ramp_height / radius
alpha = math.asin(1 - height_ratio)
length = math.cos(alpha) * radius
@creimers
creimers / vcards_remove_pictures.py
Created May 3, 2021 07:06
Python script to remove images from vcards (vcf) files.
import argparse
def main(file_path):
with open(file_path, "r") as the_file:
content = the_file.read()
new_lines = []
for line in content.split("\n"):
if (";" not in line and ":" not in line) or "PHOTO" in line:
pass
else:
convert *.HEIC -set filename:base "%[basename]" "%[filename:base].jpg"
jpegoptim *.jpg
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install autoconf libtool libdaemon-dev libasound2-dev libpopt-dev libconfig-dev -y
sudo apt-get install avahi-daemon libavahi-client-dev -y
sudo apt-get install libssl-dev -y
cd ~
git clone https://github.com/mikebrady/shairport-sync.git
@creimers
creimers / example.jsx
Created April 24, 2020 14:43
react render props children
const Ding = (props) => {
const {children} = props
return children(
{text: "dong"}
)
}
const Dong = () => (
<Ding>
{({text}) => (