Skip to content

Instantly share code, notes, and snippets.

View Sythelux's full-sized avatar
🐻
Always Beary ready

Sythelux Rikd Sythelux

🐻
Always Beary ready
View GitHub Profile
@Sythelux
Sythelux / folder-thumbnailer
Created January 25, 2024 14:35
Cinnamon Folder Thumbnailer
#!/bin/bash
# LICENSE: BSD3-Clause
# made by Sythelux Rikd
# DESC: this script creates a montage of images within a folder to create a folder icon for nemo
# it respects folder.jpg and .folder.jpg being set
# it is rather imperformant, maybe someone will improve it.
# needs to be put into /usr/bin/folder-thumbnailer
@Sythelux
Sythelux / WaitOnTask.cs
Created August 5, 2020 08:34
A CustomYieldInstruction for Unity that just wraps waiting on a task.
///<author email="dersyth@gmail.com">Sythelux Rikd</author>
public class WaitOnTask : CustomYieldInstruction
{
private Task _task;
private bool _taskDone;
public override bool keepWaiting => !_taskDone;
public WaitOnTask(Task task)
{
@Sythelux
Sythelux / move
Last active August 15, 2018 20:05
my move is supposed to copy source to target recursively. if target already exists it checks file size. if size is the same delete old one. if size is different keep old and new
#!/bin/bash
# my move is supposed to copy source to target recursively. if target already exists it checks file size
#if size is the same delete old one
#if size is different keep old and new
source=$1
target=$2
IFS=$'\n'
if [ -d "$source" ]; then
@Sythelux
Sythelux / Serie3.java
Last active April 27, 2017 13:28
Example implementation of ADS Exercise
package ads;
import java.text.MessageFormat;
import java.util.*;
/**
* Created by sythelux on 25.04.17.
*/
public class Serie3 {
private static Random random = new Random();
@Sythelux
Sythelux / base.skin
Created September 29, 2016 15:29
basic skin template for plantuml skins
skinparam Activity {
ArrowColor
ArrowFontColor
ArrowFontName
ArrowFontSize
ArrowFontStyle
BackgroundColor
BarColor
BorderColor
BorderThickness
@Sythelux
Sythelux / ReusableIDGenerator.java
Created May 13, 2016 13:05
Little ID Generator, that makes ids reusable after freeing
public class ReusableIDGenerator {
private static Map<Integer, Boolean> map = Collections.synchronizedMap(new HashMap<Integer, Boolean>());
private ReusableIDGenerator() {}
public static int get() {
for (int i = 0; i < Integer.MAX_VALUE; i++) {
if (map.containsKey(i)) {
if (!map.get(i)) {
map.put(i, true);
@Sythelux
Sythelux / TimeFlowParser.java
Created March 9, 2016 15:52
converts time on format like: "1d14h5min5sec40ms" to millis or vice versa
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
*
* @author Sythelux Rikd
@Sythelux
Sythelux / myService.sh
Created February 11, 2016 14:01
debian service Script for jars
#!/bin/sh
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides: MyApp
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
@Sythelux
Sythelux / timeAsGif.java
Created January 8, 2016 11:37
shows current Time as realtime gif
@GET
@Path("timeAsGif.gif")
@Produces("image/gif")
public Response timeAsGif() throws IOException {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream(255);
ImageOutputStream output = ImageIO.createImageOutputStream(bos);
GifSequenceWriter writer = new GifSequenceWriter(output, BufferedImage.TYPE_BYTE_INDEXED, (int) TimeUnit.MINUTES.toMillis(1), false);
@Sythelux
Sythelux / LICENSE.java
Last active September 3, 2015 12:35
Just my typical BSD-License
/*
*Copyright (c) 2015, Sythelux Rikd All rights reserved.
*
*Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.