This file contains hidden or 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 json | |
class JLoader(object): | |
def __init__(required=None): | |
self._required = required | |
def _check_arguments(self, keys): | |
keys = set(keys) | |
if required: |
This file contains hidden or 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
# Monkey-ptch pyflakes to respect lines with flake8 methods of ignoring | |
# lines and files. | |
def _report_with_ignore(self, messageClass, *args, **kwargs): | |
with open(self.filename, 'r') as code: | |
cont = code.readlines() | |
lineno = args[0].lineno | |
if '# noqa' in cont[lineno-1]: | |
return | |
elif '# flake8: ' + 'noqa' in ''.join(cont): | |
return |
This file contains hidden or 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 | |
# Function to return whether the specified file is text/binary. | |
# Returning true/false | |
# | |
# Add this file to your PATH to make available and ensure that it has | |
# executable privileges. | |
# | |
# Example usage: | |
# istext <file> | |
[[ "$(file -b $1)" == *"text"* ]] |
This file contains hidden or 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 | |
# Function to return the extension of a file | |
# Returning the extension as a string (e.g. ".txt") or false otherwise. | |
# | |
# Add this file to your PATH to make available and ensure that it has | |
# executable privileges. | |
# | |
# Example usage: | |
# splitext <file> | |
[[ "${1}" = *.* ]] && echo ".${1##*.}" || false |
This file contains hidden or 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/sh | |
# Function to diff an image using imagemagick, displaying the original images | |
# and the diff. | |
# | |
# Add this file to your PATH to make available and ensure that it has | |
# executable privileges. | |
# | |
# Example usage: | |
# imgdiff <image1> <image2> | |
# http://askubuntu.com/questions/209517/does-diff-exist-for-images |
This file contains hidden or 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/sh | |
# Function to verify user want to run the commant. | |
# | |
# Add this file to your PATH to make available and ensure that it has | |
# executable privileges. | |
# | |
# Example usage: | |
# confirm && <command> | |
# http://stackoverflow.com/questions/3231804/in-bash-how-to-add-are-you-sure-y-n-to-any-command-or-alias |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:05f4a43c46ca589337d846930f349fcde8b87fa125b344c972943419fd6f2999" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
This file contains hidden or 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/sh | |
# Configure your favorite diff program here. | |
DIFF="/usr/bin/vimdiff" | |
# Subversion provides the paths we need as the sixth and seventh | |
# parameters. | |
LEFT=${6} | |
RIGHT=${7} | |
# Call "svn diff --force" to end up here with binary files. |
This file contains hidden or 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/sh | |
# Add the following to the [helpers] section of ~/.subversion/config | |
# merge-tool-cmd = /path/to/svn_merge_vimdiff.sh | |
BASE=${1} | |
THEIRS=${2} | |
MINE=${3} | |
MERGED=${4} | |
WCPATH=${5} |