This file contains hidden or 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
| @Rule | |
| public TestRule loggingRule = new TestWatcher() { | |
| protected void starting(Description description) { | |
| Logger logger = LoggerFactory.getLogger(description.getClassName()); | |
| logger.info("Starting: {}", description.getMethodName()); | |
| } | |
| }; |
This file contains hidden or 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 object utils { | |
| /** | |
| * Helper that allows to call private methods on Scala/Java objects. | |
| * | |
| * Usage: `someObject.exposeMethod('methodName)(arg1, arg2, arg3)` | |
| * | |
| * See: https://gist.github.com/EugenyLoy/5873642543f869c7e25f | |
| */ | |
| implicit class ExposePrivateMethods(obj: AnyRef) { |
This file contains hidden or 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
| curl -i https://api.github.com/repos/EugenyLoy/awesome-github > `date -u '+%F'_%H_%M`.txt |
This file contains hidden or 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
| module IO where | |
| import System.IO | |
| import Control.Exception | |
| import Control.DeepSeq | |
| import Control.Monad.Trans.Either | |
| import Control.Monad.Trans.Class | |
| import Data.Either.Combinators | |
| import System.Environment |
This file contains hidden or 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
| classpath.add(("org.scalaz" , "scalaz-core_2.11" ,"7.2.2")) |
This file contains hidden or 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
| clear ; close all; clc | |
| % helpers used later --- | |
| function [result] = measureError(X, y, theta) | |
| result = linearRegCostFunction(X, y, theta, 0); | |
| endfunction | |
This file contains hidden or 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 matplotlib.pyplot as plt | |
| def axline(xdata, ydata, ax = plt.subplot(111), *args, **kwargs): | |
| try: | |
| x1 = xdata[0] | |
| y1 = ydata[0] | |
| except: | |
| # assume first point coordinates given as numbers | |
| x1 = float(xdata) |
This file contains hidden or 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.apache.log4j.Logger | |
| import org.apache.log4j.Level | |
| Logger.getLogger("org").setLevel(Level.ERROR) | |
| Logger.getLogger("akka").setLevel(Level.ERROR) |
This file contains hidden or 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
| Searching --------------------------------------------------------------------- | |
| Find all files that has full filename pattern "YYY" in this rdirectory, recursive: | |
| find . -wholename "YYY" | |
| Find all matches of regexp "XXX" in file YYY: | |
| grep -n -E "XXX" YYY | |
| Find all occurences of "XXX" in all files with name "YYY" in this directory, recursive: | |
| find . -name "YYY" -print0 | xargs -0 grep -n -F "XXX" |
This file contains hidden or 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
| export PS1='\[\033[01;37m\]\u@\h\[\033[01;32m\] \w $(__git_ps1 "\n[%s]") | |
| \$\[\033[00m\] ' |
OlderNewer