Skip to content

Instantly share code, notes, and snippets.

View jmaupetit's full-sized avatar

Julien Maupetit jmaupetit

View GitHub Profile
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2016 Yannick Loiseau <me@yloiseau.net>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
"""
on-modify hook for taskwarrior.
This hook connects taskwarrior and watson.
@yloiseau
yloiseau / watson-conky.md
Last active May 27, 2016 08:14
Watson i3 status (via conky)

To display the current watson status in your i3 bar using conky:

  • in the conky configuration, add:
{"full_text": "${texeci 5 ~/.config/i3/watson-status}"}
  • in ~/.config/i3/watson-status:
#!/bin/bash
watson status |
sed -r '
@SpotlightKid
SpotlightKid / README.md
Last active September 22, 2017 07:47 — forked from yloiseau/watson-notify
Watson desktop notifier (Python)

Requirements

Indirect dependencies in parentheses:

  • python-notify2 (python-dbus, python-gi)
  • python-arrow (python-dateutil)
  • Watson (click)

Installation

#!/bin/bash
#
# Copyright © 2016 Yannick Loiseau <me@yloiseau.net>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
#
#==============================================================================
# Script to check if you are working on a project with Watson and display a
# notification when:
import unittest
class MetaTest(type):
def __new__(cls, name, bases, attrs):
for k, v in attrs['generation_data'].items():
def test_function(self):
self.assertTrue(v[0]**2, v[1])
attrs['test_%s' % k] = test_function
return super(MetaTest, cls).__new__(cls, name, bases, attrs)
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@jrsmith3
jrsmith3 / doi2bib.py
Last active January 5, 2024 09:17
Python method to access crossref.org DOI bibtex metadata resolver
import requests
def doi2bib(doi):
"""
Return a bibTeX string of metadata for a given DOI.
"""
url = "http://dx.doi.org/" + doi
headers = {"accept": "application/x-bibtex"}
@brunobord
brunobord / kill.js
Created January 30, 2013 23:21
Casper Script: restart Alwaysdata processes.
/**
* Casper script to restart Alwaysdata processes.
*
* Usage:
* $ casperjs kill.js email@example.com mysecretpassword
*/
var casper = require('casper').create();
casper.start("https://admin.alwaysdata.com/login/");
@nautilebleu
nautilebleu / gist:2953267
Created June 19, 2012 09:38
Use python 2.7 on Alwaysdata servers
# Get the binary from ActiveState.
$ wget http://downloads.activestate.com/ActivePython/releases/2.7.2.5/ActivePython-2.7.2.5-linux-x86_64.tar.gz
# Create a src directory at the root of your account.
$ mkdir src
# Install python 2.7
$ ActivePython-2.7.2.5-linux-x86/install.sh
# The installer will prompt you to choose a directory. As the default is /opt/ActivePython-2.7, choose
# the previously created directory.
Enter directory in which to install ActivePython. Leave blank and
press 'Enter' to use the default [/opt/ActivePython-2.7].