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
xiaohanyu /
Last active May 11, 2019
Data-weekly technology section list

This gist and its comments contains some topics for technology section of data weekly

emptymalei / error message installing nokogiri
Last active May 8, 2019
gem install nokogiri problem
View error message installing nokogiri
An error occurred while installing nokogiri
(1.8.0), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.8.0'
--source ''` succeeds before
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();
Susensio /
Last active Sep 6, 2019
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 bellow).

Two options:

  • Child redefines value property completely, both getter and setter.
View protector.rb
require 'base64'
require 'digest'
require 'openssl'
require 'fileutils'
module Jekyll
class ProtectedPage < Page
def aes256_encrypt(password, cleardata)
digest =
gbaman /
Created Nov 1, 2017
An example on using the Github GraphQL API with Python 3
# An example to get the remaining rate limit using the Github GraphQL API.
import requests
headers = {"Authorization": "Bearer YOUR API KEY"}
def run_query(query): # A simple function to use to make the API call. Note the json= section.
request ='', json={'query': query}, headers=headers)
if request.status_code == 200:
messefor /
Last active Nov 7, 2018
Example to show how to plot histogram with accumulate ratio. Plot multiple histograms using seaborn.FacetGrid().
"""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
pcmasuzzo /
Last active Jan 23, 2019
Some useful seaborn snippets
# import
import seaborn as sns
import matplotlib.pyplot as plt
# white background in plots
# df is a pandas dataframe
# plot by column by variable 'var1', in 3 columns, coloring by variable 'var2'
grid = sns.FacetGrid(df, col='var1', col_wrap=3, hue='var2', size=4, palette='Set2')
View OpticalIllusion.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
deepak365 / How to install redash in mac.
Last active Dec 4, 2019
How to install redash in mac.
View 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
docker-compose -f docker-compose.production.yml run --rm server create_db
docker-compose -f docker-compose.production.yml up
You can’t perform that action at this time.