Skip to content

Instantly share code, notes, and snippets.

View grangerp's full-sized avatar

Philippe Granger grangerp

View GitHub Profile
@grangerp
grangerp / iris.csv
Created July 30, 2020 14:44
iris dataset
5.1 3.5 1.4 0.2 Iris-setosa
4.9 3.0 1.4 0.2 Iris-setosa
4.7 3.2 1.3 0.2 Iris-setosa
4.6 3.1 1.5 0.2 Iris-setosa
5.0 3.6 1.4 0.2 Iris-setosa
5.4 3.9 1.7 0.4 Iris-setosa
4.6 3.4 1.4 0.3 Iris-setosa
5.0 3.4 1.5 0.2 Iris-setosa
4.4 2.9 1.4 0.2 Iris-setosa
4.9 3.1 1.5 0.1 Iris-setosa
@grangerp
grangerp / app.py
Created October 15, 2019 18:55
single file django app
import html
import os
import sys
from django.conf import settings
from django.core.wsgi import get_wsgi_application
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import path
from django.utils.crypto import get_random_string
@grangerp
grangerp / Pipfile
Last active June 14, 2019 16:13
Pipenv automatically upgrade dependencies
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
click = "*"
requests = "*"
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
attrs = "*"
isort = "*"
@grangerp
grangerp / convert_image.py
Created April 12, 2018 17:39
convert image white to transparency
from PIL import Image, ImageOps
def convert(src, dst, size=(224, 224)):
original = Image.open(src)
thumb = ImageOps.fit(original, size, Image.ANTIALIAS)
if thumb.mode == 'RGBA':
#!/usr/bin/env bash
# Install Xcode Command Line Tools.
xcode-select --install
# Install Homebrew.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install brew basics (auto-updating).
brew install terminal-notifier
@grangerp
grangerp / .vimrc
Created May 8, 2017 14:13 — forked from ericbn/.vimrc
Vim Powerline-like status line without the need of any plugin
" Statusline (requires Powerline font)
set statusline=
set statusline+=%(%{'help'!=&filetype?bufnr('%'):''}\ \ %)
set statusline+=%< " Where to truncate line
set statusline+=%f " Path to the file in the buffer, as typed or relative to current directory
set statusline+=%{&modified?'\ +':''}
set statusline+=%{&readonly?'\ ':''}
set statusline+=%= " Separation point between left and right aligned items
set statusline+=\ %{''!=#&filetype?&filetype:'none'}
set statusline+=%(\ %{(&bomb\|\|'^$\|utf-8'!~#&fileencoding?'\ '.&fileencoding.(&bomb?'-bom':''):'')

Keybase proof

I hereby claim:

  • I am grangerp on github.
  • I am grangerp (https://keybase.io/grangerp) on keybase.
  • I have a public key ASBud272OZcNK0YYlIT9gQzlOGjIpFfyeD4O5WJPAt9q-Qo

To claim this, I am signing this object: