Skip to content

Instantly share code, notes, and snippets.

Homebrew - Scala 2.10.4
Install Tapped version of Scala 2.10.4 (old version)
> brew install homebrew/versions/scala210
Unlink version of Scala 2.11 (if installed)
> brew unlink scala
Link Tapped version of Scala 2.10.4
> brew link scala210 --force
@cstrap
cstrap / mailtrap.py
Created March 17, 2015 15:34
Integrate mailtrap.io - plain python
import smtplib
from email.mime.text import MIMEText
msg = MIMEText('There was a terrible error that occured and I wanted you to know!')
msg['Subject'] = 'Hello world'
msg['From'] = 'from@example.com'
msg['To'] = 'to@example.com'
username = 'mailtrap.io username'
password = 'mailtrap.io password'
@kmader
kmader / README.md
Last active October 31, 2023 14:21
Beating Serialization in Spark

Serialization

As all objects must be Serializable to be used as part of RDD operations in Spark, it can be difficult to work with libraries which do not implement these featuers.

Java Solutions

Simple Classes

For simple classes, it is easiest to make a wrapper interface that extends Serializable. This means that even though UnserializableObject cannot be serialized we can pass in the following object without any issue

public interface UnserializableWrapper extends Serializable {
 public UnserializableObject create(String parm1, String parm2);
@dideler
dideler / example.md
Last active February 17, 2024 20:24
A python script for extracting email addresses from text files.You can pass it multiple files. It prints the email addresses to stdout, one address per line.For ease of use, remove the .py extension and place it in your $PATH (e.g. /usr/local/bin/) to run it like a built-in command.

The program below can take one or more plain text files as input. It works with python2 and python3.

Let's say we have two files that may contain email addresses:

  1. file_a.txt
foo bar
ok ideler.dennis@gmail.com sup
 hey...user+123@example.com,wyd
hello world!