Skip to content

Instantly share code, notes, and snippets.

View nicoddemus's full-sized avatar

Bruno Oliveira nicoddemus

View GitHub Profile
@nicoddemus
nicoddemus / apply_dates.py
Created December 5, 2016 19:22
Reads dates from git and updates CHANGELOG entries From pytest-dev/pytest#721
from __future__ import absolute_import, division, print_function, unicode_literals
import re
import subprocess
with open('CHANGELOG.rst') as f:
changelog_lines = f.readlines()
output = subprocess.check_output('git log --tags --simplify-by-decoration --pretty="format:%ci %d"', shell=True)
tags_and_dates = {}
try:
os.remove(filename)
except PermissionError as e:
print('THIS PID', os.getpid())
import psutil
for proc in psutil.process_iter():
try:
files = proc.open_files()
except psutil.AccessDenied:
continue
@nicoddemus
nicoddemus / conftest.py
Created February 24, 2017 21:03
pytest plugin that shows environment variables when the build fails
def pytest_terminal_summary(terminalreporter, exitstatus):
import os
if exitstatus != 0 and 'JENKINS_URL' in os.environ:
markup = {'yellow': True, 'bold': True}
terminalreporter.write_sep("=", "ENVIRONMENT", **markup)
for k, v in sorted(os.environ.items()):
if k:
terminalreporter.write_line('%r: %r' % (k, v), **markup)
@nicoddemus
nicoddemus / conf.yaml
Created March 4, 2017 18:33
Configuration for conda-mirror while testing it a little
blacklist:
- name: "*"
- license: "*agpl*"
- license: None
- license: ""
- build: "*py34*"
- build: "*py36*"
whitelist:
- build: "*py27*"
@nicoddemus
nicoddemus / remove-item.ps1
Created April 7, 2017 18:27
Remove directory recursively measuring time in powershell
param(
[string]
$Directory
)
Measure-Command { Remove-Item -Recurse -Force $Directory }

Pytest 3.1.4.dev106+g10ded399 (2017-07-26)

Bug Fixes

  • Set stdin to a closed PIPE in pytester.py.Testdir.popen() for avoid unwanted interactive pdb (#2023)
@nicoddemus
nicoddemus / normalize_line_endings.bat
Last active August 3, 2017 19:52
Normalize line endings in repository based on .gitattributes from etk
@echo off
if not exist ..\etk (
echo Could not find ..\etk
exit /b 1
)
copy ..\etk\.gitattributes .
if errorlevel 1 exit /b 1
# from: https://doc.qt.io/qt-5/qtcharts-nesteddonuts-example.html
import functools
import random
from PyQt5.QtChart import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
class Widget(QWidget):
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:annotation>
<xs:documentation xml:lang="en">JUnit test result schema for the Apache Ant JUnit and JUnitReport tasks
Copyright © 2011, Windy Road Technology Pty. Limited
The Apache Ant JUnit XML Schema is distributed under the terms of the Apache License Version 2.0
http://www.apache.org/licenses/
@nicoddemus
nicoddemus / AutoHotkey.ahk
Created September 11, 2017 03:30
Dark Souls 2 KeyBinds for autohotkey
; This script maps mouse buttons to keyboard buttons to allow circumventing DSII's limited
; mouse button mapping and double-click related lag. Unfortunately, AutoHotKey doesn't
; seem to support more than five buttons.
; Installation
; 1) Download AutoHotKey.
; 2) In Dark Souls II, make sure the mouse buttons you're using in this script aren't bound to anything to avoid conflicts.
; This script uses Left and Right Click, Middle click is disabled by default, and buttons 4 and 5 aren't supported by DSII.
; 3) Run Dark Souls II and map the commands to the keyboard letter associated with the mouse button desired.
; Right Click - G