Skip to content

Instantly share code, notes, and snippets.

View nok's full-sized avatar

Darius Morawiec nok

View GitHub Profile
"""
=====================================================
Distance computations for masked arrays (:mod:`scipy.spatial.mdistance`)
=====================================================
.. sectionauthor:: Damian Eads, Jason Merkin
Function Reference
------------------
[core]
excludesfile = ~/.gitignore_global
pager = diff-so-fancy | less --tabs=4 -RFX
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[alias]
aa = add --all
@dr-dimitru
dr-dimitru / .htaccess
Last active April 2, 2018 22:05
.htaccess file for Laravel 4 and Laravel 3 | For root/ folder
# ----------------------------------------------------------------------
# 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.
@mrdanadams
mrdanadams / _pems.scss
Created March 29, 2012 13:32
PX to EMs conversion in Sass
/* 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;
@fabeat
fabeat / scale.py
Created September 19, 2013 10:13 — forked from enagorny/scale.py
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:
@gwatts
gwatts / github-release-stats.py
Last active March 22, 2021 07:22
Formats the release download stats for a Github project.
#!/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:
@MichaelCurrie
MichaelCurrie / autopep8 Travis-CI.md
Last active April 26, 2021 17:18
Automatically fix PEP-8 issues using Travis-CI

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>)
@gupta-shrinath
gupta-shrinath / 00-android-bypass-certificate-pinning-and-mitm-attack-setup.md
Last active July 24, 2022 12:42 — forked from approovm/00-android-bypass-certificate-pinning-and-mitm-attack-setup.md
Certificate Pinning Bypassing: Setup with Frida, mitmproxy and Android Emulator with a writable file system
@james-see
james-see / torhasher.py
Created January 23, 2017 21:15
create a hashed password for control port setting in torrc HashedControlPassword line easily with this
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