This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)" | |
PROMPT='⌚ %{$fg_bold[red]%}%*%{$reset_color%} ${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserValidator { | |
private Cryptographer cryptographer; | |
public boolean checkPassword(String userName, String password) { | |
User user = UserGateway.findByName(userName); | |
if (user != User.NULL) { | |
String codedPhrase = user.getPhraseEncodedByPassword(); | |
String phrase = cryptographer.decrypt(codedPhrase, password); | |
if ("Valid Password".equals(phrase)) { | |
Session.initialize(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StaticClass { | |
static { | |
throwsException(); | |
} | |
private static void throwsException() { | |
throw new RuntimeException("bam!"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.json4s._ | |
import org.json4s.jackson.JsonMethods.parse | |
import scala.io.Source.fromURL | |
object SparkAppStats { | |
/** | |
* (partial) representation of a Spark Stage object | |
*/ | |
case class SparkStage(name: String, shuffleWriteBytes: Long, memoryBytesSpilled: Long, diskBytesSpilled: Long) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.yammer.metrics.Metrics | |
import com.yammer.metrics.core.Gauge | |
import org.apache.spark.SparkContext | |
/** | |
* Created by tzachz on 10/21/15 | |
*/ | |
object SparkContextInstrumentor { | |
def instrument(context: SparkContext): SparkContext = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fetch the relevant plugin code | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'eu.appsatori:gradle-fatjar-plugin:0.2-rc1' | |
classpath 'com.kenshoo:gradle-fpm:+' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ch.qos.logback.classic.Logger; | |
import ch.qos.logback.classic.LoggerContext; | |
import ch.qos.logback.classic.spi.ILoggingEvent; | |
import com.yammer.dropwizard.ConfiguredBundle; | |
import com.yammer.dropwizard.config.Bootstrap; | |
import com.yammer.dropwizard.config.Environment; | |
import com.yammer.dropwizard.logging.AsyncAppender; | |
import me.moocar.logbackgelf.GelfAppender; | |
import org.slf4j.LoggerFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sets up a dropwizard-based service packaged as debian | |
# requires: puppetlabs-apt, puppetlabs-stdlib | |
class sample-dw-service ( | |
$version='latest', # you can pass a specified version, default is latest | |
$db_url='' # this is how you pass environment-specific configuration - in this case, a DB URL | |
) { | |
# refresh apt | |
notify { "refreshing apt": | |
notify => Class['apt::update'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ch.qos.logback.classic.Level; | |
import com.kenshoo.test.LogbackVerifier; | |
import org.junit.Rule; | |
import org.junit.Test; | |
public class MyTest { | |
@Rule | |
public LogbackVerifier logbackVerifier = new LogbackVerifier(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kenshoo.rtb.tools; | |
import org.junit.Test; | |
import static junit.framework.Assert.assertTrue; | |
import static org.mockito.Mockito.mock; | |
import static org.mockito.Mockito.when; | |
/** | |
* Created by IntelliJ IDEA. |
OlderNewer