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
Make a file executable in git on Windows | |
git update-index --chmod=+x <file-name> | |
Forces all line endings to LF in your git repo. | |
https://gist.github.com/ajdruff/16427061a41ca8c08c05992a6c74f59e |
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
sed -i 's/\r$//' <file_path> |
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
First setup PowerShell: | |
Open PowerShell from start menu or shortcut (windows key + x, i) | |
Install posh-git module - Install-Module posh-git -Scope CurrentUser | |
Close PowerShell | |
Create profile.ps1 in ~/Documents/WindowsPowerShell with Content below | |
Open PowerShell again | |
profile.ps1 | |
-------------------------- |
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
https://prezi.com/xgwyp3reqanc/ubuntu-debian-ramdisk/ |
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
alias gitclean="git fetch -p -t && git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d" |
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 com.discover.dps.common.logging; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.slf4j.LoggerFactory; | |
import com.google.caliper.Benchmark; |
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 java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import ch.qos.logback.classic.pattern.ClassicConverter; | |
import ch.qos.logback.classic.spi.ILoggingEvent; | |
public class MyCustomConverter extends ClassicConverter { | |
private final static Pattern PATTERN = Pattern.compile("\\b(([0-9]{5,8})[0-9]{4}([0-9]{4}))|((0[1-9]|1[0-2])[0-9]{2})\\b"); |
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
#!/bin/bash | |
# | |
# Startup script for a spring boot project | |
# | |
# chkconfig: - 84 16 | |
# description: Spring Boot project | |
# Source function library. | |
[ -f "/etc/rc.d/init.d/functions" ] && . /etc/rc.d/init.d/functions | |
[ -z "$JAVA_HOME" -a -x /etc/profile.d/java.sh ] && . /etc/profile.d/java.sh |
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.junit.After; | |
import org.junit.Before; | |
import org.junit.runner.RunWith; | |
import org.mockito.ArgumentCaptor; | |
import org.mockito.Captor; | |
import org.mockito.Mock; | |
import org.mockito.runners.MockitoJUnitRunner; | |
import org.slf4j.LoggerFactory; | |
import ch.qos.logback.classic.Logger; |
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
when(mock.myFunction(anyString())).thenAnswer(new Answer<String>() { | |
@Override | |
public String answer(InvocationOnMock invocation) throws Throwable { | |
Object[] args = invocation.getArguments(); | |
return (String) args[0]; | |
} | |
}); |
NewerOlder