Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View vaab's full-sized avatar

Valentin Lab vaab

View GitHub Profile
@vaab
vaab / .travis.yml
Created May 14, 2014 05:45
Travis config to use with ``autogen.sh`` file.
language: python
python:
- "3.4"
- "3.3"
- "2.7"
install: ./autogen.sh && python setup.py install && python setup.py develop easy_install "$(./autogen.sh --get-name)[test]"
script:
- nosetests $(./autogen.sh --get-name)
- git reset --hard HEAD ; git clean -d -f ; python setup.py sdist --formats=gztar && pip install "dist/$(./autogen.sh --get-name)-$(./autogen.sh --get-version | tr "_" "-").tar.gz" --upgrade
@vaab
vaab / jslint-emacs-reporter.js
Created September 20, 2012 07:15
JSLint/JSHint emacs reporter
/*jshint node: true */
var reporter_name = "jhlint";
module.exports = {
reporter: function (results, data) {
"use strict";
var str = '',
errors = [];
@vaab
vaab / map_canvas.css
Last active October 13, 2015 21:28
A google chart like Canvas widget for drawing circles and coloring region in "La Réunion"
.tooltip_map {
font-size: 12px;
width: 200px;
position: absolute;
display: none;
z-index: 999;
padding: 3px;
margin: 0px;
border: 1px solid #efefef;
border-radius: 4px;
@vaab
vaab / pycheckers.py
Created September 20, 2012 06:31
Python script to combine pep8, pylint and hopefully other python code analyzer
#!/usr/bin/env python
# link: http://www.emacswiki.org/emacs/PythonMode#toc7
#
# This is a script which runs and parses the output of various Python code
# checking programs to work with flymake. It has lots of issues, one being that
# flymake does not seem to show more than one error message per line of code,
# meaning that an error or warning which is intentionally left unfixed can mask
# an error or warning that would get more attention.
#
# Additionally, the scripts which check python code are either rather anemic,
@vaab
vaab / setup.py
Last active March 23, 2017 12:03
Common ``setup.py`` to use with ``autogen.sh`` along with a ``setup.cfg``.
#!/usr/bin/env python
##
## You can download latest version of this file:
## $ wget https://gist.github.com/vaab/e0eae9607ae806b662d4/raw -O setup.py
## $ chmod +x setup.py
##
## This setup.py is meant to be run along with ``./autogen.sh`` that
## you can also find here: https://gist.github.com/vaab/9118087/raw
##
@vaab
vaab / autogen.sh
Last active April 12, 2017 01:08
tabs to space, depends fixes
#!/bin/sh
##
## You can download latest version of this file:
## $ wget https://gist.github.com/vaab/9118087/raw -O autogen.sh
## $ chmod +x autogen.sh
##
##
## Functions
@vaab
vaab / yaml_ordered_dict.py
Created January 11, 2016 09:14 — forked from enaeseth/yaml_ordered_dict.py
Load YAML mappings as ordered dictionaries
import yaml
import yaml.constructor
try:
# included in standard lib from Python 2.7
from collections import OrderedDict
except ImportError:
# try importing the backported drop-in replacement
# it's available on PyPI
from ordereddict import OrderedDict
@vaab
vaab / docker-update
Last active November 18, 2022 12:16
docker-update
#!/bin/bash
## Updates an existing image with given script coming from stdin.
##
exname=$(basename $0)
usage="$exname DOCKER_IMAGE
Update image with stdin instruction.
@vaab
vaab / win_subprocess.py
Last active February 3, 2023 03:11
Fixing python 2.7 windows unicode issue with ``subprocess.Popen``.
# -*- coding: utf-8 -*-
## Copyright (C) 2021 Valentin Lab
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions
## are met:
##
## 1. Redistributions of source code must retain the above copyright
## notice, this list of conditions and the following disclaimer.