Skip to content

Instantly share code, notes, and snippets.

View michidk's full-sized avatar
🐳
🐳🐳

Michael Lohr michidk

🐳
🐳🐳
View GitHub Profile
@michidk
michidk / .gitlab-ci.yml
Last active April 7, 2021 13:02
Gitlab deploy to branch
stages:
- build
- deploy
build:
stage: build
image: node:11
before_script:
- npm install --progress=false --unsafe-perm
script:
- npm run build
@michidk
michidk / bdrf.sprj
Last active March 14, 2021 14:41
SHADERRed BRDF Shader
<?xml version="1.0"?>
<project version="2">
<pipeline>
<pass name="BRDF" type="shader" active="true" patchverts="1">
<shader type="vs" path="shaders\vertex.vk" entry="main" />
<shader type="ps" path="shaders\fragment.vk" entry="main" />
<inputlayout>
<item value="Position" semantic="POSITION" />
<item value="Normal" semantic="NORMAL" />
<item value="Texcoord" semantic="TEXCOORD0" />
@michidk
michidk / timezones.json
Created May 31, 2020 20:37
Timezone to coordinates lookup table
{
"Africa/Abidjan": {
"latitude": 51.9,
"longitude": -40.2
},
"Africa/Accra": {
"latitude": 53.3,
"longitude": -13
},
"Africa/Addis_Ababa": {
@michidk
michidk / sevdesk-api.py
Last active April 17, 2019 08:18
Medium: sevDesk API
# we use the requests and json package
import requests
import json
# define request headers
headers = {'Authorization': '<your API-token here>',
'Content-Type': 'application/x-www-form-urlencoded'}
# we got the url from the swagger documentation.
# it's also possible to pass parameters as '?limit=10&embed=contact' to the url, to limit the response array or to embed referenced objects
@michidk
michidk / Dockerfile
Created January 7, 2019 08:30
Kalidocker
FROM kalilinux/kali-linux-docker
RUN apt-get update -y --fix-missing
RUN apt-get upgrade -y ; apt-get autoremove -y
ENV TZ=Europe/Berlin
CMD tail -f /dev/null
@michidk
michidk / CustomUnlitShaderTemplate.shader
Created January 20, 2018 13:57
Amplify Shader Editor: Better Default Unlit Shader Template
Shader /*ase_name*/ "CustomUnlit" /*end*/
{
Properties
{
/*ase_props*/
}
SubShader
{
Tags{ "RenderType" = "Opaque" "LightMode" = "ForwardBase" /*ase_tags*/ }
@michidk
michidk / OutlineShader.shader
Last active August 21, 2025 04:09
An outline shader made for Unity with the help of @OverlandGame. It adjusts the size of the outline to automatically accomodate screen width and camera distance.
// An outline shader made for Unity with the help of @OverlandGame by @miichidk
// It adjusts the size of the outline to automatically accomodate screen width and camera distance.
// See how it looks here: https://twitter.com/OverlandGame/status/791035637583388672
// How to use: Create a material which uses this shader, and apply this material to any meshrenderer as second material.
Shader "OutlineShader"
{
Properties
{
_Width ("Width", Float ) = 1
_Color ("Color", Color) = (1,1,1,1)
@michidk
michidk / TreeRandomizerWindow.cs
Created April 6, 2016 20:21
Unity3D Tree Randomizer
using System;
using System.CodeDom;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using UnityEngine;
using UnityEditor;
using Random = UnityEngine.Random;
@michidk
michidk / TagManager.cs
Created March 21, 2016 13:41
Unity3D: a class which checks if a tag is defined. also could create new ones or remove them.
public static class TagManager
{
private const string TAG_MANAGER_PATH = "ProjectSettings/TagManager.asset";
public static bool ContainsTag(string tag)
{
SerializedProperty prop;
if (GetAssetDatabase(out prop))
{
for (int i = 0; i < prop.arraySize; i++)
@michidk
michidk / gist:6f076258f38f29be77cb
Created January 28, 2016 22:44
C# is awesome
These 3 pieces of codes, are all returning wether a list/dictionary has elements or not.
Normal:
int count = 0;
foreach (var ep in IPEndPoints)
{
if (ep.Value == null)
{
count++;
}