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/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/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
# 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
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
/path/to/python -c "from idlelib.PyShell import main; main()" & |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/usr/bin/env python2.7 | |
""" | |
The following script is used for writing code comments offline and writing | |
them in a format suitable for the given version control software and | |
potentially ticketing system. Example: svn + trac (edgewall). | |
Example usage | |
------------- | |