Skip to content

Instantly share code, notes, and snippets.

View zbigniewTomczak's full-sized avatar

Zbigi zbigniewTomczak

View GitHub Profile
@zbigniewTomczak
zbigniewTomczak / maven-jar-lifecycle.md
Created December 8, 2012 16:22
Maven JAR lifecycle
  • process-resources resources:resources
  • compile compiler:compile
  • process-test-resources resources:testResources
  • test-compile compiler:testCompile
  • test surefire:test
  • package jar:jar
  • install install:install
  • deploy deploy:deploy
@zbigniewTomczak
zbigniewTomczak / maven-exec.md
Created December 8, 2012 19:09
Maven exec plugin usage
mvn exec:java -Dexec.mainClass="com.example.Main" [-Dexec.args="argument1"] 

OR


  <project>
  ...
  <build>
    <plugins>
      <plugin>
 <groupId>org.codehaus.mojo</groupId>
@zbigniewTomczak
zbigniewTomczak / maven-dependency.md
Created December 8, 2012 19:21
Maven dependency
mvn dependency:resolve

mvn dependency:tree

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
 </plugin>
git tag v1.0-Final #sets lightweight tag as v1.0-Final on last commit
git tag #list tags

git push --tags #pushes tags to github

@zbigniewTomczak
zbigniewTomczak / good-unit-test.md
Last active July 29, 2018 16:55
Good unit test properties and definition by The art of unit testing Oshevore

Good unit test properties:

  • It should be automated and repeatable.
  • It should be easy to implement.
  • Once it’s written, it should remain for future use.
  • Anyone should be able to run it.
  • It should run at the push of a button.
  • It should run quickly.

Good unit test definition:

@zbigniewTomczak
zbigniewTomczak / td-phases.md
Last active December 10, 2015 04:18
TDD phases

TDD phases

  1. Write a test
  2. Make it compile
  3. Run it to see that it fails
  4. Make it run
  5. Remove duplication

Stack Overflow single most influential book

  • Code Complete (2nd edition) by Steve McConnell
  • The Pragmatic Programmer
  • Structure and Interpretation of Computer Programs
  • The C Programming Language by Kernighan and Ritchie
  • Introduction to Algorithms by Cormen, Leiserson, Rivest & Stein
  • Design Patterns by the Gang of Four
  • Refactoring: Improving the Design of Existing Code
  • The Mythical Man Month
start 'c:\path\export.sql';
int a = 4, b = 6;

a^= b^= a^= b;

Works for all types including strings and floats.