Skip to content

Instantly share code, notes, and snippets.

View emaxerrno's full-sized avatar
💭
I may be slow to respond.

Alexander Gallego emaxerrno

💭
I may be slow to respond.
View GitHub Profile
// Parses the following json object and creates stats for opentsdb
//
// {
// "Broadcast": {
// "Strategy": "1",
// "proxies": [
// {
// "domain": "test.com",
// "hosts": [
// {
import sbt._
object Dependencies {
val resolutionRepos = Seq(
// Required for our Scalaz snapshot
"Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/releases/",
// For some misc Scalding and Twitter libs
"Concurrent Maven Repo" at "http://conjars.org/repo",
// For Twitter's util functions
#!/bin/bash
DESTINATION=/usr/local/Cellar/tomcat/7.0.41/libexec/webapps
SOURCE=/Users/agallego/workspace/tld/portal/target/ROOT.war
rm -rf $DESTINATION/ROOT*
cp $SOURCE $DESTINATION
/usr/local/Cellar/tomcat/7.0.41/bin/catalina run

How to change Pantheon Terminal's color scheme

Many of us spend many hours of our days using their terminal. Plus, we all have different tastes when it comes to color schemes. That's why the ability to change the color scheme of a terminal is one of its more important featuresl. Throughout this tutorial, I'll teach you how you can change the looks of your terminal, step by step.

This tutorial is aimed at elementary OS users, but it also works for any Ubuntu user. Start by installing dconf-tools:

sudo apt-get install dconf-tools

Secondly, you need to decide which theme you're going to apply. You can find dozens of terminal color schemes online, you can even design your own using this web application. Design the color scheme, hit "Get Scheme" and choose "Terminator". You'll get a raw text file with a background color, a foreground color and a palette. Those strings define your color scheme. In this tutorial, I'll post an

/**
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* contenteditable attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that are clearfixed.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
*/
.cf:before,
package com.yieldmo.hadoop.scalding
import com.yieldmo.common.admodels.EventSequence
import com.yieldmo.common.admodels.adserver.PageViewLogData
import com.yieldmo.common.protobuf.Events
object NaiveUtils {
type TupleList = List[(Long,Long,String,String)]
def eventSeqToTupleList(seq: EventSequence): TupleList = {
(seq.getPageView() match {
@emaxerrno
emaxerrno / NaiveUtils.scala
Created August 20, 2013 17:11
Clean naivemo start
package com.yieldmo.hadoop.scalding
import com.yieldmo.common.admodels.EventSequence
import com.yieldmo.common.admodels.adserver.PageViewLogData
import com.yieldmo.common.protobuf.Events
object NaiveUtils {
type TupleList = List[(Long,Long,String,String)]
def eventSeqToTupleList(seq: EventSequence): TupleList = {
(seq.getPageView() match {
@Override
public boolean next(K key, V value) throws IOException {
if (eof) {
return false;
}
if (firstRecord) { // key & value are already read.
firstRecord = false;
return true;
}
@emaxerrno
emaxerrno / gist:6295519
Created August 21, 2013 14:52
next(key,value) --> no configuration to prevent checking for pointer equality
@Override
public boolean next(K key, V value) throws IOException {
if (eof) {
return false;
}
if (firstRecord) { // key & value are already read.
firstRecord = false;
return true;
}
@emaxerrno
emaxerrno / gist:6298433
Created August 21, 2013 18:38
tooNested.scala
def tupleListForPageView(pvld: PageViewLogData): TupleList = {
import com.yieldmo.hadoop.scalding.DiscreteVariableStates._
val isCell = (Option(pvld.getCellular()) getOrElse false).asInstanceOf[Boolean]
val location = Option(pvld.getLocation()) getOrElse { new Location }
var metro = "other"
var country = "other"
Option(location).foreach { loc: Location =>
if (loc.getMetroCode != 0) metro = "" + loc.getMetroCode
Option(loc.getCountryCode) foreach { x: String => country = getCountry(x) }
}