Skip to content

Instantly share code, notes, and snippets.

View e-kotov's full-sized avatar
🎯
Focusing

Egor Kotov e-kotov

🎯
Focusing
View GitHub Profile
@e-kotov
e-kotov / GH-CF-strict-SSL-w-CDN.md
Created December 22, 2023 12:26 — forked from zbeekman/GH-CF-strict-SSL-w-CDN.md
Setting up GH-pages with custom domain, strict (end-to-end) SSL with CloudFlare DNS & CDN

Custom domains, GH-pages, Cloudflare and strict SSL end-to-end encryption

Why I wrote this

Before Github supported SSL encryption for github pages sites, many people were using CloudFlare (CF) as their DNS provider and CDN proxy. CF allowed users to enable SSL encryption from the CDN end points/proxies to the end user. This was great and it allowed visitors to your website to connect with a secure connection between their browser and the cloudflare CDN box that was serving your content. However, with this setup one (significant) link in the chain remained unencrypted and

@e-kotov
e-kotov / export_google_starred_locations.py
Created April 28, 2017 20:08 — forked from endolith/export_google_starred_locations.py
Export Google Maps starred locations
# -*- coding: utf-8 -*-
"""
Go to Google Bookmarks: https://www.google.com/bookmarks/
On the bottom left, click "Export bookmarks": https://www.google.com/bookmarks/bookmarks.html?hl=en
After downloading the html file, run this script on it to generate a KML.
"""
@e-kotov
e-kotov / data_mos_ru_bti_wkt.R
Created December 3, 2015 23:39
R code for downloading Moscow BTI (building addresses and geometry) and save it to QGIS compatible CSV with WKT-encoded geometry
# See https://goo.gl/KHQnlk for a video walkthrough.
# Load and/or install missing packages
p <- c("data.table")
install_package <- function(pack)
{if(!(pack %in% row.names(installed.packages())))
{
update.packages(ask=F)
install.packages(pack,dependencies=T)
@e-kotov
e-kotov / spatial_data_read_write_speed_test.R
Last active September 18, 2015 23:03
Benchmark the speed of reading and writing spatial data in R - find the best way to store data for analysis (spoiler - best speed is for spatial objects stored in *.rds files and shapefiles are the slowest to load)
# spatial data loading time benchmark
# Warning : you may need to manually install rgdal from source, if it fails to install automatically
# first install missing packages
# thanks to Pratik Patil for the package installation code ( http://stackoverflow.com/a/29622385 )
# Specify the list of required packages to be installed and load
Required_Packages = c("data.table", "rgdal", "sp", "ggplot2", "reshape2")
Install_And_Load <- function(Required_Packages) {
@e-kotov
e-kotov / great_circle_lines.R
Last active January 25, 2016 16:30
Showcase of creation and plotting of great circle lines
# this code showcases creation and plotting of great circle lines
# first install missing packages
# thanks to Pratik Patil for the package installation code ( http://stackoverflow.com/a/29622385 )
# Specify the list of required packages to be installed and load
Required_Packages = c("leaflet", "sp", "geosphere", "scales")
Install_And_Load <- function(Required_Packages) {
Remaining_Packages <- Required_Packages[!(Required_Packages %in% installed.packages()[,"Package"])]