Skip to content

Instantly share code, notes, and snippets.

View AlessandroChecco's full-sized avatar

Alessandro Checco AlessandroChecco

View GitHub Profile
@AlessandroChecco
AlessandroChecco / README.md
Created April 4, 2018 18:21 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

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

Parent

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

iframe

git clone https://github.com/caseywatts/mediawiki
heroku apps:create MYAPPNAME
echo "web: vendor/bin/heroku-hhvm-apache2" >> Procfile
curl -sS https://getcomposer.org/installer | php
php composer.phar update
# add & commit composer.lock

heroku buildpacks:add heroku/php
heroku ps:scale web=1
@AlessandroChecco
AlessandroChecco / Spark Dataframe Cheat Sheet.py
Last active August 6, 2023 20:21 — forked from evenv/Spark Dataframe Cheat Sheet.py
Cheat sheet for Spark Dataframes (using Python)
# 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.
@AlessandroChecco
AlessandroChecco / index.html
Last active March 17, 2017 01:11
Ethical From
<!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
pd.unique(df.column_name.ravel())
# 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)]