Skip to content

Instantly share code, notes, and snippets.

View marinho's full-sized avatar

Mario Brandao marinho

  • stuff stuff @ SAP
  • Berlin, Germany
View GitHub Profile
@marinho
marinho / find-kubeconfig.fish
Last active November 28, 2024 07:27
Fish scripts to set kubectl and k9s to use kubeconfig from current directory
function find-kubeconfig
set dir (pwd)
while true
if test -d "$dir/.kube"
echo "$dir/.kube"
return
end
if test "$dir" = "/"
@marinho
marinho / option_l_to_at.json
Last active March 12, 2024 12:53
MX Keys Business Karabine-Elements key mappings
{
"description": "Map Left/Right Option + L to @",
"manipulators": [
{
"from": {
"key_code": "l",
"modifiers": {
"mandatory": [
"left_option"
],
@marinho
marinho / InkCanvas.cs
Created November 14, 2023 12:20
Code to leave an ink print on ground as the player moves
using Godot;
using System.Linq;
using System.Collections.Generic;
using Isometric3DEngine;
public partial class InkCanvas : Node3D
{
[Export]
public int MaximumAmountOfDrops = 100;
@marinho
marinho / ripple-effect.glsl
Created November 2, 2023 18:14
SImple shaders in GLSL
/*
* http://editor.thebookofshaders.com/
*/
#ifdef GL_ES
precision mediump float;
#endif
#define PI 3.14159265359
@marinho
marinho / golan-levin-bezier.glsl
Last active November 2, 2023 17:33
Collection of shader trigonometrical functions
// Created by Golan Levin and collaborators
// Source: http://www.flong.com/archive/texts/code/shapers_bez/
// This code isn't 100% compatible with GLSL, but can be easily ported to
//------------------------------------------------
// Quadratic Bezier
float quadraticBezier (float x, float a, float b){
// adapted from BEZMATH.PS (1993)
@marinho
marinho / clock.glsl
Last active October 29, 2023 08:45
Clock shader
// Author: Mario Brandao
// Title: a siple clock written in GLSL and executed in http://editor.thebookofshaders.com/
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
@marinho
marinho / parent_better_exporter_fbx.py
Last active December 13, 2022 18:56
Blender Addon using Better FBX Exporter to export in parent objects with respective children, filtered by name starting with a given value.
"""
Install this Python script as addon in Blender to export parent objects with respective children
to separate files in batch.
Animations are not supported by default.
Find out more about Better FBX Exporter at: https://www.blendermarket.com/products/better-fbx-importer--exporter
"""
import bpy
@marinho
marinho / NeutrinoPressKeyEvent.cs
Created September 28, 2022 19:55
Extending SciFi UI PressEventKey to support Unity's New Input System
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.UI;
using Michsky.UI.Shift;
public class NeutrinoPressKeyEvent : PressKeyEvent
{
[Header("Input System")]
@marinho
marinho / TwelveAIActionMoveTowardsInitialPosition.cs
Last active August 2, 2023 09:32
AIBrain Decision and Action for Character to move back to initial position
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MoreMountains.TopDownEngine;
using MoreMountains.Tools;
namespace Twelve {
public class TwelveAIActionMoveTowardsInitialPosition : AIAction
{
protected CharacterMovement _characterMovement;
@marinho
marinho / UnityBuildForMultiplePlatforms.cs
Created February 17, 2022 06:16
A class and script to build a game in Unity project to multiple platforms at once, either by one click Unity main menu, or via command line call. In fact, this with these utilities, I'm able to build more often and find building issues earlier than if I did it manually.
#if UNITY_EDITOR
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor;
public class UnityBuildForMultiplePlatforms : MonoBehaviour
{