Skip to content

Instantly share code, notes, and snippets.

View michal-lipski's full-sized avatar
🏠
Working from home

Michal Lipski michal-lipski

🏠
Working from home
View GitHub Profile
@michal-lipski
michal-lipski / EmailSender.java
Last active March 7, 2018 22:23
inversion_of_controll
package com.app.email;
public interface EmailSender {
void send(String recipient, String message);
}
@michal-lipski
michal-lipski / git-user-activity.sh
Created September 15, 2017 12:30
Number of days in git project per user.
# number of days beetween first and last commit by user
mapfile -t authors < <( git log --pretty=format:%an | sort | uniq )
echo "Number of authors:" ${#authors[@]}
for author in "${authors[@]}"
do
lastCommitDate=`git log --pretty=format:%at --author="$author" | sed -n 1p`
firstCommitDate=`git log --pretty=format:%at --author="$author" | tail -1`
if [ ! -z "$lastCommitDate" ];
# avg number of commits per month in date range
input_start=2017-3-1
input_end=2017-9-1
startdate=$(date -I -d "$input_start") || exit -1
enddate=$(date -I -d "$input_end") || exit -1
d="$startdate"
sum=0
count=0

Exercise 1. Download and install Jenkins

  1. Go to https://jenkins.io
  2. Download war file
  3. Run using java from Terminal java -jar jenkins.war
  4. Go to http://localhost:8080
  5. Customize with default plugins
  6. Cretate first Admin user
BankAccountA{
void TransferMoneyTo(transactionToken,toAccountId,amount){
if(this.HasPendingTransactions){
throw new BusinessException("Transactions in process");
}
if(availableBalance-amount<0){
throw new BusinessException("...");
package com.pragmatists;
import junitparams.JUnitParamsRunner;
import junitparams.Parameters;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(JUnitParamsRunner.class)
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'game',
{preload: preload, create: create, update: update, render: render}
);
function preload() {
game.load.spritesheet('dude', '../assets/dude.png', 32, 48);
game.load.spritesheet('chick', '../assets/chick.png', 16, 18);