This file contains 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
""" | |
===================================================== | |
Distance computations for masked arrays (:mod:`scipy.spatial.mdistance`) | |
===================================================== | |
.. sectionauthor:: Damian Eads, Jason Merkin | |
Function Reference | |
------------------ |
This file contains 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
[core] | |
excludesfile = ~/.gitignore_global | |
pager = diff-so-fancy | less --tabs=4 -RFX | |
[difftool "sourcetree"] | |
cmd = opendiff \"$LOCAL\" \"$REMOTE\" | |
path = | |
[alias] | |
aa = add --all |
This file contains 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
# ---------------------------------------------------------------------- | |
# ROOT/ folder .htaccess | |
# ---------------------------------------------------------------------- | |
# Laravel Note: | |
# Note: Laravel is designed to protect your application code, | |
# and local storage by placing only files that are necessarily | |
# public in the public folder. It is recommended that you either | |
# set the public folder as your site's documentRoot (also known as a web root) | |
# or to place the contents of public into your site's root directory | |
# and place all of Laravel's other files outside the web root. |
This file contains 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
/* See http://mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/ */ | |
/* Default font size in pixels if not overridden. */ | |
$baseFontSize: 16; | |
/* Convert PX units to EMs. | |
Ex: margin-right: pem(16); | |
*/ | |
@function pem($pxval, $base: $baseFontSize) { | |
@return #{$pxval / $base}em; |
This file contains 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
from PIL import Image | |
def scale(image, max_size, method=Image.ANTIALIAS): | |
""" | |
resize 'image' to 'max_size' keeping the aspect ratio | |
and place it in center of white 'max_size' image | |
""" | |
im_aspect = float(image.size[0])/float(image.size[1]) | |
out_aspect = float(max_size[0])/float(max_size[1]) | |
if im_aspect >= out_aspect: |
This file contains 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/python | |
# Little script to display file download statistics for | |
# the published releases of a Github project. | |
# | |
# (c) Gareth Watts 2015 | |
# <gareth@omnipotent.net> | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: |
PEP-8 is a set of Python style recommendations. pep8
is a module that checks your .py
file for violations. To make your Travis-CI build fail if you have any violations, you could add these lines to your .travis.yml
:
before_install:
- pip install pep8
script:
# Run pep8 on all .py files in all subfolders
# (I ignore "E402: module level import not at top of file"
# because of use case sys.path.append('..'); import <module>)
This is a gist used in the following blog posts:
This file contains 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 os, binascii, hashlib | |
#supply password | |
secret = 'your password here you want to use' # all you need to change! | |
#static 'count' value later referenced as "c" | |
indicator = chr(96) | |
#used to generate salt | |
rng = os.urandom |
OlderNewer