Skip to content

Instantly share code, notes, and snippets.

View manzke's full-sized avatar

Daniel Manzke manzke

View GitHub Profile
@manzke
manzke / DeletePathSnippet.java
Last active October 5, 2017 13:20
Delete path recursively with NIO.2
if (Files.exists(path)) {
if (Files.isDirectory(path)) {
Files.walkFileTree(path, new FileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
throws IOException {
return FileVisitResult.CONTINUE;
}
@Override
@manzke
manzke / Together.h
Last active December 18, 2015 02:49
Getting started with ECM Together on filenshare.com
#import <filenshareSDK_OSX/Service.h>
#import <filenshareSDK_OSX/Space.h>
@manzke
manzke / Iterables.java
Created August 24, 2013 20:43
Example how an iterator can look like to use a BlockingQueue in java's foreach so this blocks if nothing in it.
public class Iterables {
public static <Type> Iterable<Type> iterable(final BlockingQueue<Type> queue){
return new Iterable<Type>() {
@Override
public Iterator<Type> iterator() {
return new Iterator<Type>() {
@Override
public boolean hasNext() {
return true;
@manzke
manzke / Threads.java
Created August 24, 2013 22:04
Threads.java - Should be used if you are working with Executors and don't want that they are going to stop your shutdown
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
/**
* Utility class for thread treatment.
*/
public final class Threads {
private Threads() {
}
@manzke
manzke / GuicyfiedLiterals.java
Last active December 23, 2015 18:39
If you are often using TypeLiterals to describe your bindings of your generic classes, I find them quite ugly and the reference is to hard. That's why I have searched for a possibility to get a layer on top of it.
package de.devsurf.echo.frameworks.rs.service.startup.guice;
import java.lang.reflect.Type;
import com.google.inject.util.Types;
import de.devsurf.common.lang.build.Builder;
import de.devsurf.echo.frameworks.rs.system.api.TypeLiteralBuilder;
import de.devsurf.echo.frameworks.rs.system.api.TypeLiteralBuilder.RawTypeLiteralBuilder;
@manzke
manzke / Templating.java
Last active December 24, 2015 20:19
A class to format message which contain named parameters like "send an email from {sender} to {recipient}".
package de.devsurf.echo.sync.utils;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import com.google.common.base.Preconditions;
/**
@manzke
manzke / install.sh
Created July 30, 2014 23:08
node, npm & grunt installation
brew unlink npm
brew uninstall npm
brew unlink node
brew uninstall node
brew cleanup
brew prune
brew doctor
brew install npm
sudo brew postinstall npm
@manzke
manzke / lock-my-mac-flow.json
Last active August 29, 2015 14:24
Lock My Mac - node-red, noble, scan ble and my Nike+ FuelBand SE
[
{
"id":"243f9c28.dbc064",
"type":"scan ble",
"uuids":"83cdc41031dd11e281c10800200c9a66",
"duplicates":true,
"name":"Scan for BLEs",
"x":82,
"y":442,
"z":"dc9ec147.23614",
@manzke
manzke / t3.log
Created August 9, 2015 13:56
File which gets downloaded through a PERL/CGI/PHP vulnerable and executes itself
#!/usr/bin/perl
#
#
my @mast3rs = ("root.edu");

Keybase proof

I hereby claim:

  • I am manzke on github.
  • I am manzke (https://keybase.io/manzke) on keybase.
  • I have a public key ASCx8QEWJ6Qo1o0cbGrC9fTlvu0YOZY4YP8w39GO0qvzGgo

To claim this, I am signing this object: