Day2Day stuff related to git :-). Not the biggest nor the most advanced one.
Due to the commit reference not found on describe in any tags (weird)
| #!/bin/sh | |
| ## | |
| ## Simple GIT Commands | |
| ## | |
| # Branch Overview | |
| echo "Adding branch overview. Use git bo to see it in action"; | |
| git config --global alias.boja 'log --all --graph --decorate=short --pretty=format:"%C(yellow bold)%h%C(white)% an%C(auto): (%ar)%+d"'; | |
| git config --global alias.bojaa 'log --pretty --format="%C(green)%ce @ -- %C(yellow)%ar -- %C(white)%h %C(blue)%s" --graph --all'; |
| public interface AsyncHandler { | |
| <T> Future<T> submit(Callable<T> callable); | |
| } | |
| public class AsyncHandlerImpl implements AsyncHandler { | |
| private static final int NUM_THREADS = 5; | |
| /* USING EXECUTORS (java 1.6) */ | |
| private ExecutorService pool = Executors.newFixedThreadPool(NUM_THREADS); | |
| /* USING EXECUTORS (java 1.7) */ | |
| private final ForkJoinPool pool = new ForkJoinPool(NUM_THREADS); | |
| @Override |
| package com.telenor.runners; | |
| import org.junit.runner.notification.RunNotifier; | |
| import org.junit.runners.BlockJUnit4ClassRunner; | |
| import org.junit.runners.model.FrameworkMethod; | |
| import org.junit.runners.model.InitializationError; | |
| import org.junit.runners.model.Statement; | |
| import java.util.concurrent.atomic.AtomicInteger; |
| import java.util.Date; | |
| import java.util.concurrent.TimeUnit; | |
| /** | |
| * Simple Stopwatch implementation in order to measure ..things. | |
| * | |
| * @author <a href="mailto:[email protected]">Vegard Aasen</a> | |
| * @since 8:30 PM | |
| */ | |
| public final class StopWatch { |
| /** | |
| * @author <a href="[email protected]">vegard.aasen/t769765</a> | |
| */ | |
| public final class SystemInformationUtils { | |
| private SystemInformationUtils() { | |
| } | |
| public synchronized static SystemInformation getCurrentSystemInformation() { | |
| final SystemInformation systemInformation = new SystemInformation(); |
| import java.util.Objects; | |
| /** | |
| * Password-class which is as safe as it gets in Java. Try to avoid using the "toString", "fromString"-methods due to | |
| * memory allocations and gc-troubles (in regards to the actual removal of the password within RAM etc. | |
| * | |
| * @author <a href="mailto:[email protected]">Vegard Aasen</a> | |
| */ | |
| public final class Password implements CharSequence, Comparable<Password> { |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>com.vegaasen.app</groupId> | |
| <artifactId>app-maven-deployer-local</artifactId> | |
| <version>1.0-SNAPSHOT</version> | |
| <name>cool-app-maven-deployer</name> | |
| <description> | |
| This pom-file uses the maven-antrun-plugin to be able to execute unix-commands within a pom.xml. |
| @Test | |
| public void misc() { | |
| final SimpleDocumentBuilderHolder documentBuilderHolder = new SimpleDocumentBuilderHolder(); | |
| ExecutorService exec = Executors.newFixedThreadPool(10); | |
| for (int i = 0; i < ROUNDS; i++) { | |
| exec.submit(new Runnable() { | |
| public void run() { | |
| try { | |
| final DocumentBuilder builder = documentBuilderHolder.allocateDocumentBuilder(); |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Net; | |
| using System.IO; | |
| using System.Security.Authentication; | |
| using System.Net.Sockets; | |
| using System.Net.Security; | |
| using System.Security.Cryptography.X509Certificates; |