Skip to content

Instantly share code, notes, and snippets.

View jehrhardt's full-sized avatar

Jan Ehrhardt jehrhardt

View GitHub Profile
@jehrhardt
jehrhardt / build.gradle
Created July 26, 2012 07:24
Groovy 2.0 with invokedynamic in Gradle
apply plugin: "groovy"
sourceCompatibility = 1.7
targetCompatibility = 1.7
compileGroovy {
groovyOptions.metaClass.optionMap = { [indy: true, encoding: "UTF-8"] }
}
compileTestGroovy {
@jehrhardt
jehrhardt / README.md
Last active December 12, 2015 05:19
Steps to create an Ubuntu Precise base box for Vagrant

Following the vagrant documentation to create a new base box running Ubuntu 12.04 and Puppet requires to do a lot of single steps. Using this simple guide may help you to go through these steps much faster.

Prerequisites

You will need to install a current version of

@jehrhardt
jehrhardt / KeyLengthDetector.java
Created March 15, 2013 06:23
Detect the allowed size of AES keys on the JVM. If the size is <= 256, it is limited. To fix it JCE unlimted stregth files are needed.
import javax.crypto.Cipher;
import java.security.NoSuchAlgorithmException;
public class KeyLengthDetector {
public static void main(String[] args) {
int allowedKeyLength = 0;
try {
allowedKeyLength = Cipher.getMaxAllowedKeyLength("AES");
} catch (NoSuchAlgorithmException e) {
@jehrhardt
jehrhardt / sbt.sh
Last active December 18, 2015 11:39
sbt start script to embed into a project. The script downloads the sbt launch JAR automatically, if not found.
#!/bin/sh
if [ -z "$SBT_VERSION" ]
then
SBT_VERSION=0.13.0
fi
SBT_LAUNCH_JAR=$HOME/.sbt/sbt-launch-$SBT_VERSION.jar
mkdir -p $HOME/.sbt
@jehrhardt
jehrhardt / shared-mime-info-mac.sh
Created September 10, 2013 07:49
Set up shared mime info on Mac OS X via Homebrew
#!/bin/sh
# Install package shared-mime-info via Homebrew
brew install shared-mime-info
# Initialize shared mime info database
update-mime-database /usr/local/share/mime
@jehrhardt
jehrhardt / .zshrc
Last active October 9, 2016 07:23
# oh-my-zsh location
ZSH=$HOME/.oh-my-zsh
# Use lambda theme
ZSH_THEME="robbyrussell"
# Use plugins for typical tools
plugins=(brew git)
# Load oh-my-zsh
@jehrhardt
jehrhardt / derjan.el
Last active February 16, 2017 15:20
My Emacs Prelude customizations - for Mac OS X
;;; derjan.el --- derjan's customizations of Emacs prelude
;; Copyright © 2013-2015 Jan Ehrhardt
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
@jehrhardt
jehrhardt / google-suggestions.rb
Last active November 10, 2024 22:45
Get suggestions from Google's completion API like http://ubersuggest.org
# Copyright © 2014 Jan Ehrhardt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
#!/bin/bash
function jira_issue()
{
curl -u $JIRA_USERNAME:$JIRA_PASSWORD $JIRA_BASEURL'/rest/api/2/issue/'$1
}
function jira_search()
{
curl -G -u $JIRA_USERNAME:$JIRA_PASSWORD "$JIRA_BASEURL/rest/api/2/search" --data-urlencode "jql=$1"

Basics

Basics lesson of the workshop.

First step

println("Hello world")

Basic types