The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the
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
$ for f in *.tar.gz | |
do | |
echo | |
echo "[$f]" | |
result=$(tar tf "$f" | grep -i 'jvm\.\(dll\|dylib\|so\)$') | |
test "$result" && echo "$result" || echo "--> NOTHING FOUND" | |
done; for f in *.zip | |
do | |
echo | |
echo "[$f]" |
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
Some Jenkinsfile examples |
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
# MIT License | |
# | |
# Copyright (c) 2017 Daniele Andreis <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
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.net.InetSocketAddress | |
import java.nio.ByteBuffer | |
import java.nio.channels.SelectionKey | |
import java.nio.channels.Selector | |
import java.nio.channels.ServerSocketChannel | |
import java.nio.channels.SocketChannel | |
import java.util.* | |
/** | |
* Represents a server. |
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
<!-- Build Script for ANT --> | |
<project basedir="." default="" name="Build Script"> | |
<property name="username" value="username"/> | |
<property name="passwd" value="passwd"/> | |
<property name="keyfile-path" value="/path-to-private-key"/> | |
<property name="applicationFolder" value="/var/www/html/"/> | |
<property name="sandboxRoot" value="${basedir}"/> |
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
# Holds repositories directory | |
sudo chown -R -v git:root /var/opt/gitlab/git-data | |
sudo chmod -R -v 0700 /var/opt/gitlab/git-data | |
# Holds git repositories | |
sudo chown -R -v git:git /var/opt/gitlab/git-data/repositories | |
sudo chmod -R -v 2770 /var/opt/gitlab/git-data/repositories | |
# Holds large object directories | |
sudo chown -R -v git:gitlab-www /var/opt/gitlab/gitlab-rails/shared |
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
Class Hasher { | |
fun hash(): String { | |
val bytes = this.toString().toByteArray() | |
val md = MessageDigest.getInstance("SHA-256") | |
val digest = md.digest(bytes) | |
return digest.fold("", { str, it -> str + "%02x".format(it) }) | |
} | |
} |
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
1. Setup a project | |
2. Add groovy SDK support: | |
https://www.bonusbits.com/wiki/HowTo:Add_Groovy_SDK_to_IntelliJ_IDEA | |
3. Download http://(yourjenkinsurl)/job/(yourpipelinejob)/pipeline-syntax/gdsl | |
- this will give you the .gdsl file - download this to the src folder of your project. | |
4. Finally follow this step - right click on the src folder -> Mark directory as -> Sources Root |
The knight is the piece in the game of chess that, in one turn, can move two squares horizontally and one square vertically or two squares vertically and one square horizontally.
An infinite chessboard is given. All of its squares are empty except for the square with coordinates (0,0), where a knight stands.
Write a function:
def solution(A, B)
that, given two numbers A and B, returns the minimum number of turns required for the knight to move from square (0,0) to square (A,B). The function should return -1 if the knight cannot reach the given square. The function should return -2 if the required number of turns exceeds 100,000,000.
NewerOlder