Skip to content

Instantly share code, notes, and snippets.

@nigjo
nigjo / updateGithubMirrors.cmd
Last active April 16, 2024 17:42
backup your Github Repos and gists
@echo off
setlocal
set githubuser=nigjo
REM -- Skript-Action fuer die "Aufgabenplanung"
REM git remote add nas n:\Backups\GithubMirrors\<repo>.git
REM git fetch nas
cd /D "%~dp0."
REM in der 'repos.list' stehen pro Zeile je ein Repo-Name.
for /F %%N in (repos.list) do (
if exist "%%~N.git" (
@nigjo
nigjo / json2svg.js
Created November 4, 2023 16:13
A single function to convert JSON Data to a SVG Element
/**
* Convert a JSON data structure to a svg element with content.
*
* Some special keys are treated as tag name ("<"), text content ("_"),
* style-attribute ("~") or child elements (">"). All other
* keys are used as attribute names to the svg element.
*
* Text content or attribute values may be a single string or an array of
* strings (joined together for output).
*
@nigjo
nigjo / button.lua
Last active January 31, 2021 14:44
A simple attempt to create UI Buttons in Löve.
-- The MIT License (MIT)
--
-- Copyright © 2021 Jens Hofschröer
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the “Software”), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
@nigjo
nigjo / Server.java
Last active March 20, 2022 15:24
A simple, insecure One-File-Java-Server to serve static pages. Main purpose is to have a simple server to locally test some github pages.
/*
* Copyright 2020 Jens "Nigjo" Hofschröer.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@nigjo
nigjo / adjustSpacing.js
Last active September 6, 2020 14:05
a simple JavaScript function to fit some text to a parent via css letter-spacing
/*
* Copyright 2020 Jens Hofschröer.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@nigjo
nigjo / gedcom.js
Last active October 23, 2020 17:08
A Simple reader od gedcom data files in JavaScript
/*
* Copyright 2020 nigjo.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@nigjo
nigjo / _plot_build_commands.cmd
Last active June 28, 2020 09:40
Vanilla Minecraft Plot Builder - A windows batch file to generate all commands for a "user build plot" on a vanilla minecraft server. Generated Commands can be pasted to the server console or send via RCON or as .mcfunction
@echo off
REM (c) 2020 by Jens Hofschröer. Use at your own risk!
REM Licence: (CC BY-SA 4.0) https://creativecommons.org/licenses/by-sa/4.0/
REM Source: https://gist.github.com/nigjo/c0f672fba7374f43118f1cc96748e602
REM
REM to create a plot relative to current player (for datapack functions)
REM run this file with parameters
REM "11+halfx" 1 "11+halfz"
REM
REM replace with regex in resultfile:
@nigjo
nigjo / clicolor.cmd
Last active June 5, 2020 15:20
Set color Env-Vars for Windows Batch scripts. DO NOT COPY PASTE THIS GIST. You should download the file to preserve the ESC characters.
@echo off
REM
REM Licensed to the Apache Software Foundation (ASF) under one
REM or more contributor license agreements. See the NOTICE file
REM distributed with this work for additional information
REM regarding copyright ownership. The ASF licenses this file
REM to you under the Apache License, Version 2.0 (the
REM "License"); you may not use this file except in compliance
REM with the License. You may obtain a copy of the License at
REM
@nigjo
nigjo / CliColor.java
Last active June 5, 2020 15:03
A class to make colored console applications.
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@nigjo
nigjo / Tag.java
Last active March 13, 2024 10:03
A simple Builder to generate HTML/XML structures. All attributes, text content or child elements are set or added in one "single" command chain.
//
// Attribution 4.0 International (CC BY 4.0)
// https://creativecommons.org/licenses/by/4.0/
//
// Original location: https://gist.github.com/nigjo/3a0590c6f5df112e87b04e63e38f21d7
// Last Changed: 2024-03-13
// Author: Jens Hofschröer <github@nigjo.de>
//
package com.github.gist.nigjo.web;