Skip to content

Instantly share code, notes, and snippets.

package cz.rank.spring;
import org.springframework.scheduling.Trigger;
import org.springframework.scheduling.TriggerContext;
import java.util.Date;
/**
* Created by karl on 7/30/15.
*/
@karl82
karl82 / gist:ef5b8e2e39ea13927725
Last active September 25, 2015 09:49 — forked from hay/gist:1351230
Enterprisify your Java Class Names!
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
@karl82
karl82 / SynchronizationTest1
Created October 9, 2013 08:24
F:\>java -version<br> java version "1.6.0_06"<br> Java(TM) SE Runtime Environment (build 1.6.0_06-b02)<br> Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)<br> <br> SynchronizationTest1:<br> client<br> Cumulative time for testX(): 51,702,940 ns<br> Cumulative time for testY(): 616,381,691 ns<br> Cumulative time for testZ(): 619,2…
/**
* Jednoduchy benchmark pro porovnani rychlostnich
* rozdilu mezi pouzitim synchronizovanych metod
* a synchronizovanych bloku.
*/
public class SynchronizationTest1 {
// dostatecny pocet iteraci pro spusteni JITu
private final static int ITERATIONS = 5000000;
// zamezime tomu, aby se do casu behu benchmarku
colorscheme darkblue
# Path to your oh-my-zsh installation.
export ZSH=/Users/####/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
@karl82
karl82 / brew-cask-upgrade-all
Last active March 25, 2016 23:05
brew cask upgrade existing
for c in `brew cask list`; do ! brew cask info $c | grep -qF "Not installed" || (brew cask uninstall --force $c && brew cask install $c); done
for c in `brew cask list`; do ! brew cask info $c | grep -qF "Not installed" || echo $c; done
@karl82
karl82 / InstanceOfTest.java
Created June 4, 2016 19:24
null instanceof Anything is always false
import org.testng.annotations.Test;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
public class InstanceOfTest {
@Test
public void testNullInstanceOf() throws Exception {
@karl82
karl82 / .gitconfig
Last active September 22, 2016 20:19
.gitconfig
[core]
editor = vim
autocrlf = input
[color]
status = auto
[merge]
tool = vimdiff
[push]
default = simple
[alias]
@karl82
karl82 / gist:474eac5494c4999e2ae9140cdcaf9b6a
Created February 18, 2017 01:34
Graal/truffel sporadic exception org.graalvm.compiler.code.SourceStackTraceBailoutException
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pascal 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ pascal ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/karl/src/pascal-truffle/pascal/src/main/resources
[INFO]