Skip to content

Instantly share code, notes, and snippets.

View corentinbettiol's full-sized avatar

Corentin Bettiol corentinbettiol

View GitHub Profile
# optional file, see https://github.com/kapt-labs/django-check-seo/wiki/How-to-add-a-check%3F
# Standard Library
import glob
from os.path import basename, dirname, isfile, join
import sys, json
from django.conf import settings
# list files
@corentinbettiol
corentinbettiol / authors.html
Created December 17, 2019 10:04
Update of the template used to show the latest blog posts by author in a djangocms-blog plugin.
{% load i18n easy_thumbnails_tags %}{% spaceless %}
<div class="plugin plugin-blog">
<h3>{% trans "Authors" %}</h3>
<ul class="blog-authors">
{% for author in authors_list %}
<li><a href="{% url 'djangocms_blog:posts-author' author.get_username %}">
{{ author.get_full_name }}
<span>(
{% if author.count > 0 %}
{% blocktrans count articles=author.count %}1 article{% plural %}{{ articles }} articles{% endblocktrans %}
@corentinbettiol
corentinbettiol / djangocms_installer.md
Last active November 23, 2023 08:09
Automated install of django + django-cms + djangocms-blog website!

As of 03/01/20, here's how I install & configure a search box on a djangocms (& djangocms-blog) project using elasticsearch:

TL;DR: It didn't work. Switch to solr.


  1. Make sure to have a fully functional django + djangocms + djangocms-blog project (see djangocms-blog installer).

  2. Install aldryn-search

As of 26/02/20, here's how I install & configure a search box on a djangocms (& djangocms-blog) project using solr:

  1. Make sure to have a fully functional django + djangocms + djangocms-blog project (see djangocms-blog installer).

  2. Install django-haystack & aldryn-search

    1. Run:
      pipenv install git+https://github.com/django-haystack/django-haystack#egg=django-haystack
      
@corentinbettiol
corentinbettiol / pypi.sh
Created January 15, 2020 15:11
Automatically build & publish package in pypi.
#!/bin/zsh
# 2019 - Corentin Bettiol
# Requires zsh, python3 & twine (python3 -m pip install --user --upgrade twine)
# Licenced under WTFPL v2
trap ctrl_c INT
function ctrl_c() {
echo "Aborting..."

Publish a project to pypi (doc)

Test

  1. Install twine
python3 -m pip install --user --upgrade twine
  1. Generating distribution archives

Les infos sur la recherche full-text

Via un soft externe

Directement via la bdd

@corentinbettiol
corentinbettiol / README.md
Last active August 7, 2024 07:24
Homemade timetracking in its simplest form.

What ?

It's a very simple timetracking tool for linux users that use systemd services & zenity.

screenshot (source)

How to install

  1. Put timetracking.sh on your computer.
@corentinbettiol
corentinbettiol / addshadows.sh
Created March 25, 2020 14:59
Take screenshot from clipboard, add shadow to screenshot, and put it in clipboard.
#!/bin/bash
xclip -selection clipboard -t image/png -o > "screenshot.png"
convert screenshot.png \( +clone -background black -shadow 75x10+0+0 \) +swap -bordercolor none -border 10 -background none -layers merge +repage shadow.png
xclip -selection clipboard -t image/png -i shadow.png
rm screenshot.png shadow.png