Skip to content

Instantly share code, notes, and snippets.

@atanasenko
atanasenko / easyshell.txt
Last active October 7, 2016 12:06
EasyShell Mintty command
C:\...\mintty.exe /bin/bash -lci ''cd `cygpath -u \''{1}\''`; bash''
C:\...\mintty.exe /bin/zsh -lc ''cd `cygpath -u \''{1}\''`; CHERE_INVOKING=1 zsh -i''
C:\...\mintty.exe /bin/zsh -lc 'cd "`cygpath \"${easyshell:container_loc}\"`"; CHERE_INVOKING=1 zsh -i'
public static class Unicorn {
private static final Set<String> V = new HashSet<String>();
public static boolean pat() {
StackTraceElement el = Thread.currentThread().getStackTrace()[2];
String key = el.getClassName() + "#" + el.getLineNumber();
if (V.contains(key))
return false;
V.add(key);
return true;
<dependencies>
<dependency>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-core</artifactId>
<version>3.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
HttpURLConnection con = (HttpURLConnection) url.openConnection();
if(con instanceof HttpsURLConnection)
{
HostnameVerifier verifier = new HostnameVerifier()
{
public boolean verify(String hostaname, SSLSession session)
{
return true;
}
@atanasenko
atanasenko / pom.xml
Last active August 29, 2015 14:19
pom.xml with custom packaging
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.example</groupId>
<artifactId>parent</artifactId>
<version>1</version>
</parent>
@atanasenko
atanasenko / components.xml
Last active August 29, 2015 14:19
custom packaging type components definition
<?xml version="1.0" encoding="UTF-8"?>
<component-set>
<components>
<component>
<role>org.apache.maven.artifact.handler.ArtifactHandler</role>
<role-hint>composite-resources</role-hint>
<implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler
</implementation>
<configuration>
@atanasenko
atanasenko / mvn.sh
Last active April 18, 2016 11:05
maven colorized
# thanks to: http://blog.blindgaenger.net/colorize_maven_output.html
# and: http://johannes.jakeapp.com/blog/category/fun-with-linux/200901/maven-colorized
# Colorize Maven Output
export M2_HOME_X="C:\\work\\app\\apache-maven-2.2.1"
export M3_HOME_X="C:\work\app\apache-maven-3.3.5"
alias _mvn='M2_HOME=$M2_HOME_X $M2_HOME_X/bin/mvn'
alias _mvn3='M3_HOME=$M3_HOME_X $M3_HOME_X/bin/mvn'
@atanasenko
atanasenko / win10.bat
Last active December 20, 2017 21:53
win10 commands
shell:::{ED834ED6-4B5A-4bfe-8F11-A626DCB6A921} -Microsoft.Personalization\pageWallpaper
@atanasenko
atanasenko / PomExecutor.java
Last active September 21, 2015 06:06
PomExecutor
@SuppressWarnings("restriction")
public class PomExecutor {
static {
DebugPlugin.getDefault().getLaunchManager().addLaunchListener(new ILaunchesListener2() {
public void launchesRemoved(ILaunch[] launches) {
for(ILaunch l: launches) {
ILaunchConfiguration conf = l.getLaunchConfiguration();
@atanasenko
atanasenko / .zshrc
Created February 9, 2016 14:43
zshrc git-prompt
source ~/.zsh-git-prompt/zshrc.sh
export PROMPT='%{$fg[blue]%}{ %c } %{$fg[green]%}$(git_super_status)%{$reset_color%} %{$fg[red]%}%(!.#.»)%{$reset_color%} '