Skip to content

Instantly share code, notes, and snippets.

View conorgriffin's full-sized avatar

Conor Griffin conorgriffin

View GitHub Profile
@conorgriffin
conorgriffin / SparkGrep.scala
Created January 8, 2016 09:49 — forked from mhausenblas/SparkGrep.scala
Scala Spark skeleton implementing grep
package spark.example
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
object SparkGrep {
def main(args: Array[String]) {
if (args.length < 3) {
System.err.println("Usage: SparkGrep <host> <input_file> <match_term>")
@conorgriffin
conorgriffin / AdTableViewCell.swift
Last active August 29, 2015 14:25 — forked from delba/AdTableViewCell.swift
MoPub iOS sdk with Swift
import UIKit
class AdTableViewCell: UITableViewCell {
// MARK: Subviews
// Add subviews and constraints...
}
#!/usr/bin/ruby
class IPGenerator
public
def initialize(session_count, session_length)
@session_count = session_count
@session_length = session_length
@sessions = {}
end
# COLORS
LIGHT_GRAY="\[\033[0;37m\]"; BLUE="\[\033[1;36m\]"; RED="\[\033[0;31m\]"; LIGHT_RED="\[\033[1;31m\]";
GREEN="\[\033[0;32m\]"; WHITE="\[\033[1;37m\]"; LIGHT_GRAY="\[\033[0;37m\]"; YELLOW="\[\033[1;33m\]";
# GIT PROMPT (http://gist.github.com/120804)
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \(\1\)/';
}
function parse_git_status {
git status 2> /dev/null | sed -e '/(working directory clean)$/!d' | wc -l;
}