Skip to content

Instantly share code, notes, and snippets.

Silvio Heuberger kungfoo

View GitHub Profile
@kungfoo
kungfoo / run-in-docker.sh
Created Feb 7, 2018
Running a gradle build on a completely clean docker container
View run-in-docker.sh
#!/bin/bash
set -e
docker run -it --rm -v $(pwd):/src openjdk:alpine /bin/sh -c "cd src; ./gradlew test assemble"
@kungfoo
kungfoo / deploy-to-glassfish-with-curl.sh
Created Nov 2, 2017
Ddeploy to glassfish using curl POST
View deploy-to-glassfish-with-curl.sh
curl --user $user:$password \
--insecure \
--progress-bar \
-H "Accept: application/json" \
-H "X-Requested-By: dummy" \
-X POST \
-F id=@build/libs/$your_war_file \
-F contextroot=$application_name -F name=$application_name \
-F force=true \
https://$glassfish_host:4848/management/domain/applications/application/
@kungfoo
kungfoo / gtk.css
Last active Aug 29, 2015
Fixing broken window shadows in GTK 3.16 and a tiling window manager
View gtk.css
.window-frame, .window-frame:backdrop {
box-shadow: 0 0 0 black;
border-style: none;
margin: 0;
border-radius: 0;
}
.titlebar {
border-radius: 0;
}
View gist:8a507b1657c82ae51d7b
public class FileDownloader extends AbstractExtension {
private boolean overrideContentType = true;
/**
* Creates a new file downloader for the given resource. To use the
* downloader, you should also {@link #extend(AbstractClientConnector)} the
* component.
*
* @param resource
@kungfoo
kungfoo / SpecialEclipsePlugin.groovy
Last active Aug 29, 2015
Creating and updating the eclipse line break and encoding in Gradle build
View SpecialEclipsePlugin.groovy
class SpecialEclipsePlugin extends SpecialPlugin {
@Override
public void apply(Project project) {
eggExtension(project).create("eclipse", EclipseExtension)
project.apply(plugin: 'eclipse')
project.afterEvaluate {
configureEclipseClasspath(it)
@kungfoo
kungfoo / Wicked_US.keylayout
Created Nov 26, 2013
Wicked Keyboard layout for macs when you program and type german.
View Wicked_US.keylayout
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard PUBLIC "" "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--Created by Ukelele version 2.1.9 on 2012-02-28 at 17:26 (GMT+01:00)-->
<!--Created by Ukelele version 2.1.9 on 2012-02-28 at 17:22 (GMT+01:00)-->
<!--Created by Ukelele version 2.1.9 on 2012-02-28 at 17:21 (GMT+01:00)-->
<!--Created by Ukelele version 2.1.9 on 2012-02-28 at 14:05 (GMT+01:00)-->
<!--Last edited by Ukelele version 2.1.9 on 2012-02-28 at 17:28 (GMT+01:00)-->
<keyboard group="29" id="30906" name="wicked U.S." maxout="1">
<layouts>
<layout first="0" last="17" modifiers="f4" mapSet="16c"/>
@kungfoo
kungfoo / .xinitrc
Last active Dec 15, 2015
Wicked layout if you type a lot of german, english and happen to be programming quite a lot. I also swap Caps Lock for Control on keyboards that have this key.
View .xinitrc
setxkbmap us_wicked -option ctrl:nocaps -option lv3:ralt_switch
exec awesome
@kungfoo
kungfoo / gist:4706143
Created Feb 4, 2013
Hotot 0.9.8.10 PKGBUILD without KDE libraries
View gist:4706143
# Maintainer: speps <speps at aur dot archlinux dot org>
pkgbase=hotot
pkgname=hotot
true && pkgname=('hotot-data' 'hotot-gtk2' 'hotot-gtk3')
pkgver=0.9.8.10
pkgrel=2
pkgdesc="A lightweight & open source microblogging software (twitter identi.ca)."
arch=('any')
url="http://www.hotot.org/"
@kungfoo
kungfoo / gist:4705468
Created Feb 4, 2013
Sample fstab entry.
View gist:4705468
/dev/sdb2 / ext4 rw,relatime,noatime,data=ordered,discard 0 1
@kungfoo
kungfoo / gist:4705440
Created Feb 4, 2013
Set scheduler to deadline for SSD disks.
View gist:4705440
# Handle the scheduler choice according to the type of disk detected
# system default : set cfq scheduler for rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq"
# SSD specific : set deadline scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"
You can’t perform that action at this time.