Skip to content

Instantly share code, notes, and snippets.

View raijinspecial's full-sized avatar

saw raijinspecial

  • The Milky Way
View GitHub Profile
@larsmans
larsmans / hellinger.py
Created July 15, 2012 13:25
Hellinger distance for discrete probability distributions in Python
"""
Three ways of computing the Hellinger distance between two discrete
probability distributions using NumPy and SciPy.
"""
import numpy as np
from scipy.linalg import norm
from scipy.spatial.distance import euclidean
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@patpohler
patpohler / Big List of Real Estate APIs.md
Last active July 28, 2024 02:06
Evolving list of Real Estate APIs by Category

Big List of Real Estate APIs

Listings / Property Data

####Rets Rabbit http://www.retsrabbit.com

Rets Rabbit removes the nightmare of importing thousands of real estate listings and photos from RETS or ListHub and gives you an easy to use import and Web API server so you can focus on building your listing search powered website or app.

@HenrikEckermann
HenrikEckermann / gist:1d334a44f61349ac71f0e235b3443a69
Created December 30, 2017 09:21
plot mean and error bars with plotnine
import pandas as pd
import numpy as np
from plotnine import *
#import data
bdf = pd.read_csv('http://www.stat.columbia.edu/~gelman/arm/examples/beauty/ProfEvaltnsBeautyPublic.csv')
#Rename btystdave to beauty for convenience
bdf.columns = ['beauty' if x=='btystdave' else x for x in bdf.columns]
bdf.info()
@esmitt
esmitt / iris_detection.py
Last active November 2, 2023 09:01
Iris detection from an eye photo
# Numpy is needed because OpenCV images in python are actually numpy arrays.
import numpy
import cv2
class iris_detection():
def __init__(self, image_path):
'''
initialize the class and set the class attributes
'''
self._img = None
@hellock
hellock / mmdetection_env.sh
Last active December 20, 2020 22:58
Setup mmdetection with conda
conda create -n open-mmlab python=3.7 -y
source activate open-mmlab
conda install -c pytorch pytorch torchvision -y
conda install cython -y
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -v -e .
mkdir data
@steinwaywhw
steinwaywhw / AWS Lambda: Hello World.md
Last active March 8, 2022 10:40
An extremely simple AWS Lambda example in Python 3.

Preface

In general, AWS services can be accessed using

  1. AWS web interface,
  2. API libraries in a programming language, such as boto3 for Python 3,
  3. AWS command-line interface, i.e. awscli.

I opted for the API library since it is

@ejlp12
ejlp12 / aws_glue_boto3_example.md
Last active March 22, 2022 18:29
AWS Glue Create Crawler, Run Crawler and update Table to use "org.apache.hadoop.hive.serde2.OpenCSVSerde"
import boto3

client = boto3.client('glue')

response = client.create_crawler(
    Name='SalesCSVCrawler',
    Role='AWSGlueServiceRoleDefault',
    DatabaseName='sales-cvs',
    Description='Crawler for generated Sales schema',
@andrewodri
andrewodri / README.md
Last active January 8, 2024 08:00
Create and Validate an ACM Certificate

This script performs the following actions:

  1. Creates a TLS certificate in ACM
  2. Upserts a validation CNAME record in Route 53
  3. Waits for the validation CNAME record to complete/update
  4. Waits for the certificate to validate and issue
  5. Outputs a description of the certificate

This obviously assumes that your domain's DNS is hosted on Route 53. It also uses the AWS credentials and region for the environment it is executed in.

@thomasbrandon
thomasbrandon / PyTorch-Resample.ipynb
Last active June 29, 2021 21:31
PyTorch implementation of scipy.signal.resample and scipy.signal.resample_poly
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.