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

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

@emptymalei
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 'https://rubygems.org/'` succeeds before
bundling.
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
Susensio / property_inheritance.md
Last active Sep 6, 2019
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.
@gbaman
gbaman / graphql_example.py
Created Nov 1, 2017
An example on using the Github GraphQL API with Python 3
View graphql_example.py
# 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 requests.post to make the API call. Note the json= section.
request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers)
if request.status_code == 200:
@messefor
messefor / hist_cum_twin_grid.py
Last active Nov 7, 2018
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
@pcmasuzzo
pcmasuzzo / seaborn_snippets.py
Last active Jan 23, 2019
Some useful seaborn snippets
View seaborn_snippets.py
# import
import seaborn as sns
import matplotlib.pyplot as plt
# white background in plots
sns.set(style="whitegrid")
# 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
deepak365 / How to install redash in mac.
Last active Nov 20, 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 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
@Dreyer
Dreyer / perlbrew_libgcc_s.txt
Created Jan 20, 2017
[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
You can’t perform that action at this time.