Skip to content

Instantly share code, notes, and snippets.

View Vaysman's full-sized avatar

Mikhail Vaysman Vaysman

  • SkyWorkz
  • Hilversum
View GitHub Profile
@Vaysman
Vaysman / gist:9053305
Last active August 29, 2015 13:56 — forked from avdi/gist:9038972
# You will need the pygments and xclip packages
# This example highlights some Bash source code
# '-O noclasses=true' tells pygments to embed colors inline in the source
# the '-t text/html' option tells xclip what "target" to specify for the selection
pygmentize -l java -f html -O noclasses=true,encoding=utf-8 Main.java | pbcopy
# Another example
pbpaste | pygmentize -l ruby -f rtf -O noclasses=true,encoding=utf-8 | pbcopy

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@Vaysman
Vaysman / server.rb
Created July 4, 2014 02:18
Simple Sinatra Application
require 'sinatra'
get '/hi' do
"Hello World!"
end

Your task will be to gain an understanding of Unit Test.

You must complete this task until January 12, 2015

This task will be taken into account in the final assessment of the course.

What you should do?

  1. Find information about unit tests and about other tests (integration test, performance test, etc)
  2. Create test suite for Bank Application
  3. Find information about Code Coverage and measure code coverage (c0) of your Bank Application
package com.luxoft.bankapp.model;
// this is an incomplete class. use it as example.
public abstract class AbstractAccount {
protected float balance;
public AbstractAccount() {
balance = 0.0f;
}
package com.luxoft.bankapp.model;
import com.luxoft.bankapp.model.exception.OverDraftLimitExceededException;
// this is an incomplete class. use it as example.
public class CheckingAccount extends AbstractAccount {
private float overdraft;
public CheckingAccount(float balance) {
super(balance);
package com.luxoft.bankapp.model;
import org.junit.Test;
import static org.junit.Assert.*;
public class AbstractAccountTest {
// dummy class for testing purpose
// there is no logic inside.
// I want test AbstractAccount not TestingAccount
package com.luxoft.bankapp.model;
import com.luxoft.bankapp.model.exception.OverDraftLimitExceededException;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
// test only CheckingAccount specific functionality
// do not test AbstractAccount functionality
@startuml
title Relationships - Class Diagram
class Dwelling {
+Int Windows
+void LockTheDoor()
}