Skip to content

Instantly share code, notes, and snippets.

@savage69kr
savage69kr / groovy_script_to_copy_jobs.groovy
Created September 20, 2024 10:03 — forked from AATHITH/groovy_script_to_copy_jobs.groovy
Copy all Jobs from a view into another view | Jenkins
// Get the original view
def originalView = jenkins.model.Jenkins.instance.getView("Old-View-Name")
// Set the new view name
def newViewName = "New-View-Name"
// Check if the new view already exists
def newView = jenkins.model.Jenkins.instance.getView(newViewName)
if (newView == null) {
// If the new view does not exist, create a new ListView
@savage69kr
savage69kr / BurstSDFGenerator.cs
Created September 19, 2024 07:29 — forked from runevision/BurstSDFGenerator.cs
Signed Distance Field generator for Unity with Burst support
/*
Based on the Anti-aliased Euclidean distance transform described by Stefan Gustavson and
Robin Strand. For further information, see https://contourtextures.wikidot.com/ and
https://web.archive.org/web/20220503051209/https://weber.itn.liu.se/~stegu/edtaa/
The algorithm is an adapted version of Stefan Gustavson's code, it inherits the copyright
statement below, which applies to this file only.
The rewrite with Unity Burst support makes the execution 40 times faster by default,
and 75 times faster if the passed in textures are both of type TextureFormat.RGBAFloat.
@savage69kr
savage69kr / GpuPrinter.cginc
Created August 20, 2024 03:45 — forked from FreyaHolmer/GpuPrinter.cginc
A unity shader .cginc to draw numbers in the fragment shader - see the first comment below for example usage!
///////////////////////////////////////////////////////////////////////////////
// ABOUT: A unity Shader .cginc to draw numbers in the fragment shader
// AUTHOR: Freya Holmér
// LICENSE: Use for whatever, commercial or otherwise!
// Don't hold me liable for issues though
// But pls credit me if it works super well <3
// LIMITATIONS: There's some precision loss beyond 3 decimal places
// CONTRIBUTORS: yes please! if you know a more precise way to get
// decimal digits then pls lemme know!
// GetDecimalSymbolAt() could use some more love/precision
@savage69kr
savage69kr / GeometryUtils.cs
Created January 16, 2024 02:37 — forked from unitycoder/GeometryUtils.cs
Unity Math & Geometry Utility : ShortestAngleDistance, IsAxisAligned, FindClosestEdge, PointOnOppositeSideOfPolygon, TriangulatePolygon, ClosestTimesOnTwoLines, ClosestPointsOnTwoLineSegments, ClosestPointOnLineSegment, ClosestPolygonApproach, PointInPolygon, ProjectPointOnPlane, OrientedMinimumBoundingBox2D, PolygonsWithinRange, PolygonVertexTo…
// source: https://docs.unity3d.com/Packages/com.unity.xrtools.utils@1.4/api/Unity.XRTools.Utils.GeometryUtils.html
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Unity.XR.CoreUtils
{
/// <summary>
/// Utility methods for common geometric operations
@savage69kr
savage69kr / ascii_movie_image_ver_1.py
Created January 3, 2024 03:26 — forked from MotionDesignStudio/ascii_movie_image_ver_1.py
Python ASCII Video And ASCII Image Creator
#!/usr/bin/env python
import sys
import cv2
import subprocess
from subprocess import call
import aalib
import Image
@savage69kr
savage69kr / SceneViewUIObjectPickerContextWindow.cs
Created December 11, 2023 05:36 — forked from yasirkula/SceneViewUIObjectPickerContextWindow.cs
Select the UI object under the cursor via right click in Unity's Scene window
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
#if UNITY_2021_2_OR_NEWER
using PrefabStage = UnityEditor.SceneManagement.PrefabStage;
using PrefabStageUtility = UnityEditor.SceneManagement.PrefabStageUtility;
Shader "Pristine Grid"
{
Properties
{
[Toggle] _WorldUV ("Use World Space UV", Float) = 1.0
_GridScale ("Grid Scale", Float) = 1.0
_LineWidthX ("Line Width X", Range(0,1.0)) = 0.01
_LineWidthY ("Line Width Y", Range(0,1.0)) = 0.01
@savage69kr
savage69kr / CircularMenu.cs
Created September 11, 2023 03:22 — forked from alexanderameye/CircularMenu.cs
Circular menu for the Unity Editor
/*
MIT License
Copyright (c) [year] [fullname]
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
@savage69kr
savage69kr / free-database-hosting.md
Created September 1, 2023 07:20 — forked from bmaupin/free-database-hosting.md
Free database hosting
@savage69kr
savage69kr / syncthing-automerge.py
Created August 25, 2023 02:48 — forked from solarkraft/syncthing-automerge.py
Monitors a Syncthing-synced directory and tries to merge conflicting files (based on https://www.rafa.ee/articles/resolve-syncthing-conflicts-using-three-way-merge/). Probably adaptable for other directory types, but only tested with Logseq (works for me™️).
import os
import time
import re
import subprocess
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
def get_relative_path(path):
return os.path.relpath(path)