Skip to content

Instantly share code, notes, and snippets.

View unix-junkie's full-sized avatar

Andrey ``Bass'' Shcheglov unix-junkie

View GitHub Profile

Steps to reproduce

unset LD_LIBRARY_PATH 
unset LD_PRELOAD 
unset _JAVA_OPTIONS 
unset JAVA_TOOL_OPTIONS

export JAVA_HOME=/usr/lib/jvm/java-1.3.1_20-sun-i386
export JRE_HOME=${JAVA_HOME}/jre
@unix-junkie
unix-junkie / cde-backdrop
Created June 19, 2023 22:49
Setting the CDE Backdrop - shell script
#!/bin/sh
#
# cde-backdrop
# Copyright © 2002 Thomas A. Fine
# License is hereby granted to redistribute for any use (commercial or
# otherwise), in whole or in part, provided only that this copyright and
# license are preserved.
#
# Version 1.0 Fri Sep 6 15:24:49 EDT 2002
@unix-junkie
unix-junkie / JMultilineTextField.java
Created July 12, 2021 13:18
JMultilineTextField.java
package com.example;
import javax.swing.JTextField;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.AbstractDocument;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import java.awt.Dimension;
import java.util.stream.Stream;
@unix-junkie
unix-junkie / RegularlyFlushingOutputStream.java
Created August 6, 2019 13:56
Quick'n'dirty OutputStream implementation which flushes each N bytes. Has concurrency issues =)
package com.example;
import java.io.BufferedOutputStream;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Paths;
import java.util.concurrent.atomic.AtomicLong;
import static java.lang.String.format;
@unix-junkie
unix-junkie / TopLevelImageDocument.css
Created July 15, 2019 09:59
chrome://global/skin/media/TopLevelImageDocument.css
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
@unix-junkie
unix-junkie / TopLevelImageDocument.css
Created July 15, 2019 09:58
resource://gre/res/TopLevelImageDocument.css
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
This CSS stylesheet defines the rules to be applied to ImageDocuments that
are top level (e.g. not iframes).
*/
@unix-junkie
unix-junkie / ImageDocument.css
Created July 15, 2019 09:57
resource://gre/res/ImageDocument.css
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* This CSS stylesheet defines the rules to be applied to any ImageDocuments,
* including those in frames.
*/
@unix-junkie
unix-junkie / Blocking.kt
Created May 31, 2019 12:40
JavaFX example using Kotlin coroutines, blocking version
import javafx.application.Application
import javafx.embed.swing.SwingFXUtils
import javafx.scene.Scene
import javafx.scene.control.Button
import javafx.scene.image.ImageView
import javafx.scene.layout.StackPane
import javafx.stage.Stage
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
@unix-junkie
unix-junkie / NonBlocking.kt
Created May 31, 2019 12:32
JavaFX example using Kotlin coroutines, non-blocking version
import javafx.application.Application
import javafx.embed.swing.SwingFXUtils
import javafx.scene.Scene
import javafx.scene.control.Button
import javafx.scene.image.ImageView
import javafx.scene.layout.StackPane
import javafx.stage.Stage
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.javafx.JavaFx
@unix-junkie
unix-junkie / TwoCoroutineDispatchersTest.kt
Last active January 15, 2019 12:49
A Kotlin coroutine showcase featuring two custom dispatchers
package com.example
import kotlinx.coroutines.experimental.*
import kotlinx.coroutines.experimental.swing.Swing
import java.awt.BorderLayout
import java.awt.Dimension
import java.awt.Font
import java.io.IOException
import java.io.PrintWriter
import java.io.StringWriter