Skip to content

Instantly share code, notes, and snippets.

View ricard33's full-sized avatar

Cédric RICARD ricard33

View GitHub Profile
@ricard33
ricard33 / todoist-cleaner.py
Created July 13, 2021 13:45 — forked from Maxr1998/todoist-cleaner.py
Python script to delete completed tasks from your Todoist Inbox
import todoist
api = todoist.TodoistAPI(token='<your_token_here')
# Initial sync of your account
api.sync()
# Find Inbox in project - can be adapted to delete completed tasks for other projects as well
projects = api.projects.all()
inbox = next(p for p in projects if 'inbox_project' in p)
@ricard33
ricard33 / version.py
Created September 27, 2017 23:24 — forked from pwithnall/version.py
Extract Python module version from git tags and repository status
# This program is placed into the public domain.
"""
Gets the current version number.
If in a git repository, it is the current git tag.
Otherwise it is the one contained in the PKG-INFO file.
To use this script, simply import it in your setup.py file
and use the results of get_version() as your package version:
@ricard33
ricard33 / gist:90cd77a19022771d194d
Created April 8, 2015 10:25
Disable accounts on Thundebird
An elegant way to manually disable (thus totally hide) an account is to edit prefs.js (make sure TB had been shut down before editing). Search for "mail.accountmanager.accounts" and edit the line like this, e.g. assuming that "account6" is the one to be disabled:
Before edit (account enabled):
user_pref("mail.accountmanager.accounts", "account1,account5,account3,account2,account4,account7,account6");
After edit (account disabled):
user_pref("mail.accountmanager.accounts", "account1,account5,account3,account2,account4,account7");
This will disable the account and completely hide it in the user interface, but preserve all account settings, servers and identities associated with the account. To reactivate it just add the account name back to the list. When you restart TB, the account and all its settings and contents will magically reappear.
@ricard33
ricard33 / redmine_to_gitlab.py
Last active May 16, 2016 18:15
Import Redmine issues to Gitlab
__author__ = 'ricard'
from redmine import Redmine
from gitlab import Gitlab
from ConfigParser import ConfigParser
config = ConfigParser()
config.readfp(open('defaults.cfg'))
redmine = Redmine(config.get('redmine', 'url'), key=config.get('redmine', 'key') )
@ricard33
ricard33 / FakeSMTPD.py
Last active December 15, 2015 22:49
A fake SMTP server in python which reports emails rate and bandwidth to console.
#!/usr/bin/env python
from __future__ import with_statement
import smtpd
import asyncore
import sys
import time
import threading
class FakeSMTPD(smtpd.SMTPServer):
def __init__(self, localaddr, remoteaddr):