Skip to content

Instantly share code, notes, and snippets.

@2xsaiko
2xsaiko / FindGNUstep.cmake
Last active December 12, 2023 01:24
CMake find module for GNUstep
include(CMakeParseArguments)
include(FindPackageHandleStandardArgs)
set(_gnustep_not_found_message)
if (NOT GNUstep_FIND_COMPONENTS)
# FIXME: there's gotta be a better way to do this
# unfortunately find modules don't work at all like config modules
set(_gnustep_force_error)
find_package_handle_standard_args(GNUstep
@2xsaiko
2xsaiko / no-facebook.conf
Created November 18, 2021 16:41
/etc/dnsmasq.d/no-facebook.conf -- config file to block Facebook through dnsmasq
address=/.cdninstagram.com/127.0.0.1
address=/.facebook.com/127.0.0.1
address=/.facebook.de/127.0.0.1
address=/.facebook.fr/127.0.0.1
address=/.facebook.net/127.0.0.1
address=/.fb.com/127.0.0.1
address=/.fb.me/127.0.0.1
address=/.fbcdn.com/127.0.0.1
address=/.fbcdn.net/127.0.0.1
address=/.fbsbx.com/127.0.0.1
# /usr/local/sbin/mkbootentry
#!/bin/bash
ROOTFS=PARTUUID=90ab8cc5-82e3-c047-a162-2c8dde238121
#CMDLINE="net.ifnames=0 fbcon=font:SUN12x22 quiet"
CMDLINE="net.ifnames=0 quiet"
KERNEL=/usr/src/linux
ENTRY_NAME=Gentoo
@2xsaiko
2xsaiko / idleinhibit-visualizer.sh
Created September 4, 2021 15:42
swaywm: displays an [I] indicator in idle-inhibiting windows
#!/bin/bash
current=""
while true; do
new="$(swaymsg -t get_tree | jq -c 'recurse(.nodes[]) | del(.nodes) | select(.type == "con") | select(.inhibit_idle) | .id')"
for id in $new; do
re="\\b$id\\b"
if ! [[ "$current" =~ $re ]]; then
@2xsaiko
2xsaiko / mimetypedetection.patch
Created August 25, 2021 21:05
Fix KDE not opening links in mime type associated application
--- a/src/widgets/krun.cpp 2020-12-19 00:28:01.038900544 +0100
+++ b/src/widgets/krun.cpp 2020-12-19 00:28:13.410897823 +0100
@@ -387,7 +387,7 @@
m_followRedirections = true;
m_window = window;
m_asn = asn;
- q->setEnableExternalBrowser(true);
+ q->setEnableExternalBrowser(false);
// Start the timer. This means we will return to the event
package cuchaz.enigma.gui.elements.rpanel;
import java.awt.*;
import java.awt.event.*;
import javax.swing.JComponent;
import javax.swing.JLayer;
import javax.swing.SwingUtilities;
import javax.swing.plaf.LayerUI;
package cuchaz.enigma.gui.util;
import java.awt.Component;
import java.awt.event.MouseEvent;
import javax.swing.*;
import javax.swing.border.Border;
public abstract class AbstractListCellRenderer<E> extends JPanel implements ListCellRenderer<E> {
@2xsaiko
2xsaiko / StrParse.java
Last active August 13, 2018 18:52
string splitter
import java.util.ArrayList;
import java.util.List;
public class StrParse {
public static List<String> qsplit(String s) {
List<String> list = new ArrayList<>();
int quote = 0;
boolean esc = false;
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import net.minecraftforge.gradle.kotlin.*
val kotlin_version: String by extra
val mappings_version: String by extra
val mc_version: String by extra
val mod_version: String by extra
val forge_version: String by extra
val jei_version: String by extra
@2xsaiko
2xsaiko / instructions.md
Last active May 13, 2018 17:01
Gradle Publish to Maven repository hosted on Git

Instructions

Put the publish.gradle.kts file next to your build.gradle.

Edit the RepoURL and RepoBranch properties. (each time you change these, make sure to delete the build/maven folder!)

Add apply from: 'publish.gradle.kts' (Groovy) or apply { from("publish.gradle.kts") } (Kotlin) to your build.gradle.

Test if everything works by executing the updateLocalRepo task, there should now be a git repository in build/maven.