Skip to content

Instantly share code, notes, and snippets.

View vorburger's full-sized avatar

Michael Vorburger vorburger

View GitHub Profile
@vorburger
vorburger / MANIFEST.MF
Created January 20, 2017 20:18
gradle-tooling-api JAR OSGi MANIFEST generated by BND, for https://github.com/gradle/gradle/issues/1216
Manifest-Version: 1.0
Bnd-LastModified: 1484882151529
Bundle-ManifestVersion: 2
Bundle-Name: org.gradle.tooling
Bundle-SymbolicName: org.gradle.tooling
Bundle-Version: 3.3.0
Created-By: 1.8.0_111 (Oracle Corporation)
Export-Package: org.gradle.api;version="3.3.0",org.gradle.api.artifact
s;uses:="org.gradle.api";version="3.3.0",org.gradle.api.logging;versi
on="3.3.0",org.gradle.api.logging.configuration;uses:="org.gradle.api
@vorburger
vorburger / FindAllSlf4jLoggersOnClasspathTest.java
Created January 12, 2017 12:04
Find all org/slf4j/Logger available on the classpath
public class FindAllSlf4jLoggersOnClasspathTest {
@Test
public void testSlf4jMess() throws IOException {
Enumeration<URL> urls = getClass().getClassLoader().getResources("org/slf4j/Logger.class");
while (urls.hasMoreElements()) {
URL url = urls.nextElement();
System.out.println(url);
}
}
@vorburger
vorburger / dmesg
Last active August 20, 2016 17:31
Raspberry Pi v3 Raspian WiFi Driver "crash" (?) with WiFi as AP using hostapd, only when HDMI plugged in
https://bugzilla.kernel.org/show_bug.cgi?id=153471
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=143972&p=1021341
[Sat Aug 20 18:14:53 2016] Booting Linux on physical CPU 0x0
[Sat Aug 20 18:14:53 2016] Initializing cgroup subsys cpuset
[Sat Aug 20 18:14:53 2016] Initializing cgroup subsys cpu
[Sat Aug 20 18:14:53 2016] Initializing cgroup subsys cpuacct
[Sat Aug 20 18:14:53 2016] Linux version 4.4.18-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #905 SMP Fri Aug 19 19:11:00 BST 2016
[Sat Aug 20 18:14:53 2016] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
package org.opendaylight.netvirt.aclservice.tests.utils.tests.inject;
import static org.junit.Assert.assertEquals;
import dagger.Component;
import javax.inject.Inject;
import javax.inject.Provider;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.netvirt.aclservice.tests.utils.inject.InstanceProvidedBy;
/*
* Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.netvirt.aclservice.tests.utils.inject;
import org.junit.runners.BlockJUnit4ClassRunner;
/*
* Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.netvirt.aclservice.tests.utils.inject;
import java.lang.reflect.Method;
/*
* Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.netvirt.aclservice.tests.utils.inject;
/**
/*
* Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.netvirt.aclservice.tests.utils.inject;
import static java.lang.annotation.ElementType.TYPE;
@vorburger
vorburger / gist:130c9951fbcae1a729c5
Last active August 29, 2015 14:19
Example of email causing Google Inbox A/HREF linkify bug
Delivered-To: mi...@gmail.com
Received: by 10.112.182.1 with SMTP id ea1csp1097818lbc;
Sun, 19 Apr 2015 15:17:27 -0700 (PDT)
X-Received: by 10.42.88.206 with SMTP id d14mr15378148icm.40.1429481846161;
Sun, 19 Apr 2015 15:17:26 -0700 (PDT)
Return-Path: <bugzilla-daemon@eclipse.org>
Received: from pmta1.delivery9.ore.mailhop.org (pmta1.delivery9.ore.mailhop.org. [54.186.172.23])
by mx.google.com with ESMTPS id j197si14363280ioj.18.2015.04.19.15.17.25
for <mi...@gmail.com>
@vorburger
vorburger / OptionalInstanceofCast.java
Created January 23, 2015 16:11
instanceof cast Optional (Guava or Java 8)
// TODO Such an Optional for instanceof cast should be available more generically, somewhere?
@SuppressWarnings("unchecked")
protected <S, T extends S> Optional<T> getOptionalSubclass(S project, Class<T> desiredSubclass) {
if (desiredSubclass.isInstance(project))
return Optional.of((T) project);
else
return Optional.absent();
}