Skip to content

Instantly share code, notes, and snippets.

@RichoDemus
RichoDemus / Java try-finally return
Created October 24, 2014 12:13
Demonstrates why return statements in finally are bad, what will be printed to std-out?
package richo.testproject.other;
import org.junit.Test;
public class TryFinallyReturnTest
{
private static final int NOT_SET = 0;
private static final int TRY = 1;
private static final int FINALLY = 2;
package richo.testproject.other;
import javax.inject.Inject;
/**
* Created by tjerngrr on 2014-10-31.
*/
public class GuiKlass
{
public class backendKlass
{
public Users[] getUsers()
{
using (entity db = new entity())
{
Users[] list = db.getUsers(); /* stored procedure i db */
list = formatUsers(list);
return list;
}
@RichoDemus
RichoDemus / ddclient.conf
Created October 29, 2015 22:17
Update multiple hosts with ddclient
# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
use=web
web=dynamicdns.park-your-domain.com/getip
# updates the host @
protocol=namecheap, server=dynamicdns.park-your-domain.com login=yourdomain.com password=<pass> \
@
#put at the end of .bashrc
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
@RichoDemus
RichoDemus / gist:2b4895216f4ff9ed7e75
Last active November 27, 2020 03:57
Xubuntu bloat
#stuff I removed after installing xubuntu
sudo apt-get purge xchat dc transmission* thunderbird* pidgin* abiword* firefox* gimp* gnomine* gmusicbrowser software-center parole gnome-sudoku evince* gnumeric* ristretto* libreoffice* xfburn gnome-mines nano && sudo apt-get --purge autoremove
@RichoDemus
RichoDemus / gist:5b75d34af9878776f04b
Created December 29, 2015 16:31
Some profile stuff
export JAVA_HOME="/opt/java/jdk1.8.0_65"
export M2_HOME="/opt/maven/apache-maven-3.3.3"
PATH="$JAVA_HOME/bin:$PATH"
PATH="$M2_HOME/bin:$PATH"
@RichoDemus
RichoDemus / gist:f285323b560202f8cf7f
Last active January 20, 2016 18:53
Remove Ubuntu bloat
sudo apt-get purge mono-common ttf-arabeyes ttf-arphic-uming ttf-indic-fonts-core ttf-kochi-gothic ttf-kochi-mincho ttf-lao ttf-malayalam-fonts ttf-thai-tlwg ttf-unfonts-core bluez-audio bluez-cups bluez-gnome bluez-utils ppp pppconfig pppoeconf wvdial gnome-orca brltty brltty-x11 gnome-accessibility-themes gnome-mag libgnome-mag2 libgtk-vnc-1.0-0 vinagre vino espeak espeak-data libespeak1 libgnome-speech7 evolution-common evolution-data-server evolution-exchange evolution-plugins evolution-webcal fortune-mod libbeagle1 contact-lookup-applet diveintopython example-content gnome-games gnome-games-data gnome-cards-data totem totem-gstreamer totem-plugins totem-common totem-mozilla rhythmbox transmission-common transmission-gtk account-* libreoffice*
@RichoDemus
RichoDemus / input.js
Created February 15, 2016 16:58
javascript weirdness
"use strict";
class Input
{
constructor(startButton)
{
this.startButton = startButton;
startButton.onclick = this.start;
}
start()
{
@RichoDemus
RichoDemus / gist:fa8290b924195bd33e60
Created February 24, 2016 07:31
Remove Manjaro bloat
25 pacman -Rsn flashplugin
26 sudo pacman -Rsn flashplugin
29 sudo pacman -Rsn gimp
33 sudo pacman -Rsn libreoffice-still
36 sudo pacman -Rsn viewnior
40 sudo pacman -Rsn pidgin
43 sudo pacman -Rsn firefox-gtk2
48 sudo pacman -Rsn hexchat
51 sudo pacman -Rsn thunderbird
57 sudo pacman -Rsn guayadeque