Skip to content

Instantly share code, notes, and snippets.

View olliefr's full-sized avatar
🌩️

Oliver Frolovs olliefr

🌩️
View GitHub Profile
@olliefr
olliefr / README.md
Created November 4, 2023 08:15
Country flags emoji in Windows fonts

National flags in Windows fonts

Context

This gist contains a copy of my comment to a Medium article named Designing in the Open(Source) published by Microsoft Design (official account).

The article is about Fluent Emoji -- a collection of emoji from Microsoft. They are kind of a big deal because they are included with every copy of Windows operating system as a Segoe UI Emoji font.

@olliefr
olliefr / dataflow.md
Last active November 12, 2022 18:29
Dataflow data generator
@olliefr
olliefr / datastore.md
Last active November 18, 2022 02:46
Datastore (Google Cloud)

Datastore is weird!

It is a legacy service tied to App Engine. Once enabled, App Engine API cannot be disabled on a Cloud project.

Cloud projects can use either Datastore or Firestore but not both. Once set, it cannot be changed. Since all legacy App Engine apps use Datastore, a different project must be used for Firestore usage.

This Codelab gives some historical context on App Engine, Datastore, and Firestore.

For Python client for Datastore API there are at least two options:

@olliefr
olliefr / gist:f2cf97267a813dab82c1baa011bbd5bb
Last active July 11, 2022 16:19
Create a new isolated environment for Python
mkdir sandpit-one && cd $_
conda create --prefix ./conda --yes python=3.8 ipython
conda activate ./conda
python -m pip install --upgrade pip
@olliefr
olliefr / awesome-cli.txt
Last active August 22, 2022 20:30
Awesome command line one-liners
# Generate a random password
openssl rand -base64 18
# Display total size of a single directory in human-readable format
du -csh /home/oliver/
# Display size of everything in a directory in human-readable format
du -csh /home/oliver/*
# Compare the output of two programs without having to save it into files first.
@olliefr
olliefr / main.tf
Created April 1, 2022 00:23
Making sense of Terraform Google provider's google_organization_policy and compute.vmExternalIpAccess constraint.
terraform {
required_version = "~> 1.1.7"
required_providers {
google = "~>4.12.0"
}
experiments = [module_variable_optional_attrs]
}
variable "gcp_organisation" {
@olliefr
olliefr / fix_cp1251_filenames.py
Created August 1, 2020 14:47
Recode file names in the current directory from CP-1251 to file system's native encoding using Python
# -*- coding: utf-8 -*-
"""
This script was written to solve a specific problem:
A large directory of video files had file names encoded in Windows-1251.
These file names would not display correctly in Windows 10 or OS X.
I wanted to recode them to the native encoding for the current file system.
Python is smart enough to apply the correct encoding when writing out
the file names to the file system.
@olliefr
olliefr / BBB_XDS110_Init.log
Created May 3, 2019 11:03
Successful Connection and Operation of 'Bone Under XDS110 Debug Probe
CortxA8: Output: **** AM335x BeagleBlack Initialization is in progress ..........
CortxA8: Output: **** AM335x ALL PLL Config for OPP == OPP100 is in progress .........
CortxA8: Output: Input Clock Read from SYSBOOT[15:14]: 24MHz
CortxA8: Output: **** Going to Bypass...
CortxA8: Output: **** Bypassed, changing values...
CortxA8: Output: **** Locking ARM PLL
CortxA8: Output: **** Core Bypassed
CortxA8: Output: **** Now locking Core...
CortxA8: Output: **** Core locked
CortxA8: Output: **** DDR DPLL Bypassed
@olliefr
olliefr / gdmpydemo.py
Created April 4, 2017 00:11
Google Distance Matrix API Python client example
# Google Distance Matrix Python Demo
# ==================================
#
# How to set up (Local part)
# --------------------------
#
# Must have Python (>= 3.4) installed with 'requests' library. On Windows, maybe try
# Anaconda Python? It has a 'conda' package manager, make sure 'requests' is installed.
#
# How to set up (Internet part)
@olliefr
olliefr / genlattice.american.public.R
Created May 26, 2016 14:22
The public interface to genlattice.american.
genlattice.vanilla.american.call <- function(Asset, Volatility, IntRate, DividendRate, Strike, Expiry, NoSteps) {
return (genlattice.american(Asset=Asset, Volatility=Volatility, IntRate=IntRate, DividendRate=DividendRate, Strike=Strike, Expiry=Expiry, NoSteps=NoSteps, Payoff=payoff.vanilla.call))
}
genlattice.vanilla.american.put <- function(Asset, Volatility, IntRate, DividendRate, Strike, Expiry, NoSteps) {
return (genlattice.american(Asset=Asset, Volatility=Volatility, IntRate=IntRate, DividendRate=DividendRate, Strike=Strike, Expiry=Expiry, NoSteps=NoSteps, Payoff=payoff.vanilla.put))
}