Skip to content

Instantly share code, notes, and snippets.

View emptymalei's full-sized avatar
📡
sending EM waves to Mars

LM emptymalei

📡
sending EM waves to Mars
View GitHub Profile
@emptymalei
emptymalei / lollipop_plotly.py
Created January 18, 2022 16:19 — forked from caiotaniguchi/lollipop_plotly.py
Plotting Lollipop Charts with Plotly
import numpy as np
import plotly.offline as pyo
import plotly.graph_objs as go
# Generate a random signal
np.random.seed(42)
random_signal = np.random.normal(size=100)
# Offset the line length by the marker size to avoid overlapping
marker_offset = 0.04
@emptymalei
emptymalei / ci.yml
Created November 15, 2021 14:14 — forked from epicfaace/ci.yml
encrypting an entire github pages (mkdocs) website with staticrypt - replace MY_PASSWORD and "YOUR SITE NAME HERE"
name: Docs
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build docs
@emptymalei
emptymalei / postal-codes.json
Created February 27, 2020 12:42 — forked from matthewbednarski/postal-codes.json
Global postal codes regex formats
[{ "Note": "The first two digits (ranging from 10–43) correspond to the province, while the last two digits correspond either to the city/delivery zone (range 01–50) or to the district/delivery zone (range 51–99). Afghanistan Postal code lookup", "Country": "Afghanistan", "ISO": "AF", "Format": "NNNN", "Regex": "^\\d{4}$"}, { "Note": "With Finland, first two numbers are 22.", "Country": "Åland Islands", "ISO": "AX", "Format": "NNNNN", "Regex": "^\\d{5}$"}, { "Note": "Introduced in 2006, gradually implemented throughout 2007.", "Country": "Albania", "ISO": "AL", "Format": "NNNN", "Regex": "^\\d{4}$"}, { "Note": "First two as in ISO 3166-2:DZ", "Country": "Algeria", "ISO": "DZ", "Format": "NNNNN", "Regex": "^\\d{5}$"}, { "Note": "U.S. ZIP codes (range 96799)", "Country": "American Samoa", "ISO": "AS", "Format": "NNNNN (optionally NNNNN-NNNN or NNNNN-NNNNNN)", "Regex": "^\\d{5}(-{1}\\d{4,6})$"}, { "Note":
@emptymalei
emptymalei / How to install redash in mac.
Last active November 20, 2019 09:26 — forked from deepak365/How to install redash in mac.
How to install redash in mac.
What is redash?
Redash is database viewer included BI tool inside. Redash has support for querying multiple databases, including: Redshift, Google BigQuery, PostgreSQL, MySQL, Graphite, Presto, Google Spreadsheets, Cloudera Impala, Hive and custom scripts.
Prerequisite :
1. Install docker
2. Install git
git clone https://github.com/getredash/redash.git
docker-compose -f docker-compose.production.yml run --rm server create_db
docker-compose -f docker-compose.production.yml up
@emptymalei
emptymalei / property_inheritance.md
Created September 6, 2019 09:21 — forked from Susensio/property_inheritance.md
Inherit property setter in python 3.7

Python @property inheritance the right way

Given a Parent class with value property, Child can inherit and overload the property while accessing Parent property getter and setter.

Although we could just reimplement the Child.value property logic completely without using Parent.value whatsover, this would violate the DRY principle and, more important, it wouldn't allow for proper multiple inheritance (as show in the example property_inheritance.py bellow).

Two options:

  • Child redefines value property completely, both getter and setter.
# This is a really old post, in the comments (and stackoverflow too) you'll find better solutions.
def find(key, dictionary):
for k, v in dictionary.iteritems():
if k == key:
yield v
elif isinstance(v, dict):
for result in find(key, v):
yield result
elif isinstance(v, list):
@emptymalei
emptymalei / perlbrew_libgcc_s.txt
Created May 8, 2019 18:14 — forked from Dreyer/perlbrew_libgcc_s.txt
[perlbrew] ld: library not found for -lgcc_s.10.4
$ cd /usr/local/lib
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.4.dylib

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@emptymalei
emptymalei / README.md
Created January 23, 2019 22:56
The Central Limit Theorem

This animation demonstrates the central limit theorem for a uniform sampling distribution.

// [START apps_script_bigquery_update_sheet]
/**
* Runs a BigQuery query and replace the existing sheet
*/
/**
* Add a custom menu to the spreadsheet when it is opened.
*/
function onOpen() {
var spreadsheet = SpreadsheetApp.getActive();