Skip to content

Instantly share code, notes, and snippets.

📡
sending EM waves to Mars

LM emptymalei

📡
sending EM waves to Mars
Block or report user

Report or block emptymalei

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@emptymalei
emptymalei / property_inheritance.md
Created Sep 6, 2019 — forked from Susensio/property_inheritance.md
Inherit property setter in python 3.7
View property_inheritance.md

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.
View gist:3b517b6382357e8b4183c455d0ce38fb
# 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 — forked from Dreyer/perlbrew_libgcc_s.txt
[perlbrew] ld: library not found for -lgcc_s.10.4
View perlbrew_libgcc_s.txt
$ 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
View gist:0db5dc160449ed8637433803cb86d067

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@emptymalei
emptymalei / README.md
Created Jan 23, 2019
The Central Limit Theorem
View README.md

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

View BigQuery_to_Google_sheet.js
// [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();
@emptymalei
emptymalei / BigQuery2GSheets.js
Created Jan 14, 2019 — forked from greenido/BigQuery2GSheets.js
An Apps script example to fetch data form Big query to google spreadsheets. For more: http://wp.me/pB1lQ-19i
View BigQuery2GSheets.js
/**
* Fetching data from BigQuery and present it in our sheet
* Author: Ido Green
* Date: 14/12/2013
*
* See: http://wp.me/pB1lQ-19i
* Misc: https://developers.google.com/bigquery/
*/
//
@emptymalei
emptymalei / hist_cum_twin_grid.py
Created Nov 7, 2018 — forked from messefor/hist_cum_twin_grid.py
Example to show how to plot histogram with accumulate ratio. Plot multiple histograms using seaborn.FacetGrid().
View hist_cum_twin_grid.py
"""Example to show how to plot histogram with accumulate ratio.
Plot multiple histogram using seaborn.FacetGrid()
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
% matplotlib inline
View pypi-release-checklist.md
  • Update HISTORY.rst
  • Commit the changes:
git add HISTORY.rst
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch
View sql-mongo_comparison.md

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

You can’t perform that action at this time.