Skip to content

Instantly share code, notes, and snippets.

Alessandro Checco AlessandroChecco

Block or report user

Report or block AlessandroChecco

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
AlessandroChecco /
Created Apr 4, 2018 — forked from pbojinov/
Two way iframe communication- Check out working example here:

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.


Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')


git clone
heroku apps:create MYAPPNAME
echo "web: vendor/bin/heroku-hhvm-apache2" >> Procfile
curl -sS | php
php composer.phar update
# add & commit composer.lock

heroku buildpacks:add heroku/php
heroku ps:scale web=1
AlessandroChecco / Spark Dataframe Cheat
Last active Oct 1, 2019 — forked from evenv/Spark Dataframe Cheat
Cheat sheet for Spark Dataframes (using Python)
View Spark Dataframe Cheat
# A simple cheat sheet of Spark Dataframe syntax
# Current for Spark 1.6.1
# import statements
#from pyspark.sql import SQLContext
#from pyspark.sql.types import *
#from pyspark.sql.functions import *
from pyspark.sql import functions as F
#SparkContext available as sc, HiveContext available as sqlContext.
View index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body>
# List unique values in a DataFrame column
# Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
# Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(valuelist)]
You can’t perform that action at this time.