This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def time_and_log(func): | |
""" | |
A decorator to call a function and log the time spent inside | |
Usage: | |
@time_and_log | |
somefunc(someargs): | |
pass | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find all the TODO in the code which need to be fixed | |
echo "Templates" | |
grep -Irn --include=*.html --exclude-dir="coverage_html" "TODO" * | |
echo -e '\nPython' | |
grep -Irn --include=*.py --exclude-dir="coverage_html"\ | |
--exclude-dir="development-tools" "TODO" * | |
echo -e '\nOther' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GitHub username: Fandekasp | |
Day job: Software Engineer | |
Favorite open source project: Python | |
Open Source contributions (if any): django-sphinx-autodoc, django-nuages (work in progress) | |
Stranded on an island, what 3 items do you take: swimsuit, laptop, wifi antenna | |
Tie-breaker, pick a number between 1 and 20,000: 15000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from fabric.api import local, lcd | |
import default_settings as settings | |
class jip(object): | |
""" | |
Pip-like tool to manage all the static modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Function: OpenPdfToSection | |
function! OpenPdfToSection() | |
let g:my_section = substitute(getline(search('\\\(sub\)\?section', 'bn')), '\\\%(sub\)\?section{\([^}]\+\)}', '\1', '') | |
" some weird trailing space can appear, remove them | |
let g:my_section = substitute(g:my_section, "^ *", "", "g") | |
let g:Tex_ViewRuleComplete_pdf = 'mupdf -f "'.g:my_section.'" -r 102 $*.pdf' | |
call Tex_ViewLaTeX() | |
" reinitialize the variable to keep <leader>lv working | |
let g:Tex_ViewRuleComplete_pdf = 'mupdf -r 102 $*.pdf' | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
File: create_github_circle.py | |
Author: Adrien Lemaire | |
Description: Generate a csv file for google+ using the github api 3 | |
''' | |
import pycurl | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def restart_server(server_name=None): | |
"""Restart the server if needed (e.g. server down due to abusive cpu usage | |
by a program | |
how to use:: | |
$ fab restart_server:serverName | |
List of available servers names: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""" | |
Required: fabric, django, coverage, django-coverage, termcolor | |
"""" | |
from coverage.misc import CoverageException | |
from termcolor import colored | |
def coverage(html=1): | |
"""Run coverage tests with html output, or | |
or return only the coverage percentage:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef fab | |
_targets() { | |
_describe -t commands "fabric targets" target_list | |
} | |
output_levels=( | |
'status: Status messages, i.e. noting when Fabric is done running, if the user used a keyboard interrupt, or when servers are disconnected from. These messages are almost always relevant and rarely verbose.' | |
'aborts: Abort messages. Like status messages, these should really only be turned off when using Fabric as a library, and possibly not even then. Note that even if this output group is turned off, aborts will still occur – there just won’t be any output about why Fabric aborted!' | |
'warnings: Warning messages. These are often turned off when one expects a given operation to fail, such as when using grep to test existence of text in a file. If paired with setting env.warn_only to True, this can result in fully silent warnings when remote programs fail. As with aborts, this setting does not control actual warning behavior, only whether warning messages are printed or hidden.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Notification timer, to drop in ~/bin/ | |
function timer () { | |
while [ "$(date "+%H:%M")" != "$exec_time" ] | |
do | |
sleep 60 | |
done | |
notify-send -i dialog-warning "$title" "$message" |
OlderNewer