To use in dev environments
- after
python manage.py shell
from django.contrib.auth.models import User| EMAIL_HOST = 'smtp.yandex.ru' | |
| EMAIL_HOST_USER = 'login@example.com' | |
| EMAIL_HOST_PASSWORD = 'password' | |
| EMAIL_PORT = 587 | |
| EMAIL_USE_TLS = True |
| import glob | |
| import os | |
| import cv2 | |
| import concurrent.futures | |
| def load_and_resize(image_filename): | |
| ### Read in the image data | |
| img = cv2.imread(image_filename) | |
| library(rgdal) | |
| library(rgeos) | |
| library(ggplot2) | |
| library(readr) | |
| library(tidyr) | |
| library(dplyr) | |
| library(grid) | |
| us <- readOGR("us_states_hexgrid.geojson", "OGRGeoJSON") |
#Mac OS X
| # What's the fastest way to determine the number of rows of a CSV in R? | |
| # ...Reading the entire CSV to only get the dimensions is likely too slow. Is there a faster way? | |
| # Benchmarks done on a EC2 r3.8xlarge | |
| # Cowritten with Abel Castillo <github.com/abelcastilloavant> | |
| m <- 1000000 | |
| d <- data.frame(id = seq(m), a = rnorm(m), b = runif(m)) | |
| dim(d) | |
| # [1] 1000000 3 | |
| pryr::object_size(d) |
| [alias] | |
| xdiff = "!f() { \ | |
| git diff "$@" $(git ls-files --modified --exclude-standard | fzf -m); \ | |
| }; f" | |
| xadd = "!f() { \ | |
| git add "$@" $(git ls-files --modified --others --exclude-standard | fzf -m); \ | |
| }; f" |
| /* | |
| ======================================================= | |
| Find Top Exec Plans to Optimize | |
| ======================================================= | |
| Author: Eitan Blumin | eitanblumin.com , madeiradata.com | |
| Date: 2020-08-12 | |
| Description: | |
| Use this script to discover execution plans with a good | |
| potential for performance optimization. | |
| Finds execution plans with warnings and problematic operators. |
| """ | |
| Shows how to do a cross join (i.e. cartesian product) between two pandas DataFrames using an example on | |
| calculating the distances between origin and destination cities. | |
| Tested with pandas 0.17.1 and 0.18 on Python 3.4 and Python 3.5 | |
| Best run this with Spyder (see https://github.com/spyder-ide/spyder) | |
| Author: Markus Konrad <post@mkonrad.net> | |
| April 2016 |