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
brew install vcprompt | |
# add to ~/.zshrc | |
setopt prompt_subst | |
export PS1='%n@%m:%~ $(vcprompt)$ ' |
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 ${PACKAGE_NAME}; | |
import org.springframework.hateoas.Link; | |
import org.springframework.hateoas.Resource; | |
public class ${NAME} extends Resource<${ENTITY}> { | |
public ${NAME}(${ENTITY} content, Link... links) { | |
super(content, links); | |
} |
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 java.util.Random; | |
import java.util.stream.IntStream; | |
class FindUnpairedOddValue { | |
public static void main(String[] args) { | |
int[] myArray = new int[100]; | |
int max = 300; | |
int min = 1; | |
if (max % 2 == 0) --max; | |
if (min % 2 == 0) ++min; |
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
https://github.com/spring-projects/spring-boot/issues/15037#issuecomment-502078304 |
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
''usage: python rename.py <folder> <suffix> | |
import sys, os | |
path = sys.argv[1] | |
suffix = sys.argv[2] | |
for filename in os.listdir(path): | |
os.rename(os.path.join(path,filename), os.path.join(path, os.path.splitext(filename)[0] + '_' + suffix +'.jpg')) |
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
/* | |
* Save a text file locally with a filename by triggering a download | |
*/ | |
var text = "hello world", | |
blob = new Blob([text], { type: 'text/plain' }), | |
anchor = document.createElement('a'); | |
anchor.download = "hello.txt"; | |
anchor.href = (window.webkitURL || window.URL).createObjectURL(blob); |
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
# 1. Create mapped directory to override docker container /config directory | |
cd c:\Users\someuser | |
mkdir docker\wlp\usr\server\dropins | |
# 2. Create server.xml under docker\wlp\usr\server allowing for remote access from host | |
<server description="default servlet engine"> | |
<!-- Enable features --> | |
<featureManager> | |
<feature>servlet-3.1</feature> |
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
$( "form" ).each(function() { | |
$(this).removeClass('dirty'); | |
}); |
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
$(document).ready(function () { | |
function defineCommonLib() { | |
var COMMON_LIB = {}; | |
COMMON_LIB.FALSE_FUNCTION = function () { | |
return false; | |
}; | |
COMMON_LIB.init = function () {}; |
NewerOlder