Skip to content

Instantly share code, notes, and snippets.

Valentin Lab vaab

Block or report user

Report or block vaab

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vaab
vaab / win_subprocess.py
Created Mar 15, 2017
Fixing python 2.7 windows unicode issue with ``subprocess.Popen``.
View win_subprocess.py
## issue: https://bugs.python.org/issue19264
import ctypes
import subprocess
import _subprocess
from ctypes import byref, windll, c_char_p, c_wchar_p, c_void_p, \
Structure, sizeof, c_wchar, WinError
from ctypes.wintypes import BYTE, WORD, LPWSTR, BOOL, DWORD, LPVOID, \
HANDLE
@vaab
vaab / yaml_ordered_dict.py
Created Jan 11, 2016 — forked from enaeseth/yaml_ordered_dict.py
Load YAML mappings as ordered dictionaries
View yaml_ordered_dict.py
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 Oct 19, 2018
docker-update
View 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 / autogen.sh
Last active Apr 12, 2017
tabs to space, depends fixes
View autogen.sh
#!/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 / setup.py
Last active Mar 23, 2017
Common ``setup.py`` to use with ``autogen.sh`` along with a ``setup.cfg``.
View setup.py
#!/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 / pycheckers.py
Created Sep 20, 2012
Python script to combine pep8, pylint and hopefully other python code analyzer
View pycheckers.py
#!/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 / map_canvas.css
Last active Oct 13, 2015
A google chart like Canvas widget for drawing circles and coloring region in "La Réunion"
View map_canvas.css
.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 / jslint-emacs-reporter.js
Created Sep 20, 2012
JSLint/JSHint emacs reporter
View jslint-emacs-reporter.js
/*jshint node: true */
var reporter_name = "jhlint";
module.exports = {
reporter: function (results, data) {
"use strict";
var str = '',
errors = [];
@vaab
vaab / .travis.yml
Created May 14, 2014
Travis config to use with ``autogen.sh`` file.
View .travis.yml
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
You can’t perform that action at this time.