Skip to content

Instantly share code, notes, and snippets.

View made-indrayana's full-sized avatar
:octocat:
curious

Made Indrayana made-indrayana

:octocat:
curious
View GitHub Profile
@made-indrayana
made-indrayana / multiple_gui_choices.bat
Created August 22, 2023 22:08 — forked from AveYo/multiple_gui_choices.bat
Simple GUI helpers for batch files
@echo off &title Multiple GUI choices via powershell snippet by AveYo &rem preview: https://i.imgur.com/JjazNR0.png
:: setup gui dialog choices
set all_choices=Option 1,Option 2,Option 3,Option4,Option5
set def_choices=Option 1,Option 2,Option5
:: Show gui dialog choices 1=title 2=all_choices 3=def_choices 4=output_variable
call :choices "Multiple GUI choices" "%all_choices%" "%def_choices%" CHOICES
:: Quit if no choice selected
if not defined CHOICES color 0c &echo ERROR! No choice selected.. &timeout /t 20 &color 07 &exit/b
:: Print choices
echo Choices: %CHOICES% & echo.
@made-indrayana
made-indrayana / mustream
Last active July 12, 2022 07:02 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line. Included mustream to do spotify search, revising the outdated cUrl search from the original sp code.
#!/bin/bash
# https://github.com/BelkaDev/mustream
# Requires a running Spotify desktop client
check::network() {
[[ $? != 0 ]] && echo "Network error: couldn't reach server." && exit 1
}
check::running() {
[[ -z $(pidof -s spotify) ]] && echo "Spotify is not running." && exit 1
@made-indrayana
made-indrayana / CLINE.lsp
Created June 30, 2022 14:54
AutoLISP to automate cable label creation
;----------------------------------------------------------------------------------
; Error Handler
;----------------------------------------------------------------------------------
(defun MI:Error (msg)
; Error guarding for when you pass Esc.
; Only works on English installs!
(if (not (member msg (list "Function cancelled" "quit / exit abort")))
; if this is genuine error, code backtrace
(progn
@made-indrayana
made-indrayana / ExecuteWithDelay.cs
Last active February 11, 2022 12:46
Executing UnityEvent with a predefined delay.
// ExecuteWithDelay.cs
// Author: Made Indrayana
// MIT License
// Delaying an execution of a UnityEvent with a variable wait time.
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
public class ExecuteWithDelay : MonoBehaviour
@made-indrayana
made-indrayana / SongSimulator.lua
Created February 7, 2022 15:50
QSC Song Simulator
timer0 = Timer.New()
Controls.OFF.EventHandler = function (valueChange)
if (Controls.OFF.Boolean) then
Controls.OFF.Color = "#F00"
timer0:Stop()
--Controls['Peak Out'].RampTime = 0.3
Controls['Peak Out'].Value = -100
--Controls['RMS Out'].RampTime = 1
Controls['RMS Out'].Value = -100
@made-indrayana
made-indrayana / DemoPlayerController.cs
Created October 19, 2021 13:51
Google Resonance's Player Controller
// Copyright 2017 Google Inc. All rights reserved.
//
// 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
// distributed under the License is distributed on an "AS IS" BASIS,
@made-indrayana
made-indrayana / AudioFader.cs
Created October 12, 2021 15:16
Simple static Class for AudioSource fade In and Out
using System.Collections;
using UnityEngine;
public static class Fade
{
public static IEnumerator In (AudioSource audioSource, float fadeTime)
{
const float startTime = 0f;
var currentTime = 0f;
audioSource.Play();
@made-indrayana
made-indrayana / LinearDecibelConverter.cs
Last active August 6, 2021 15:10
Small utilities to convert Linear value (0-1) to dB and vice versa - Yes I'm looking at you Unity - as well as FMODs Internal Bus Volume
// LinearDecibelConverter.cs
// Author: Made Indrayana
// MIT License
// Small utilities to convert Linear value (0-1) to dB and vice versa
public class LinearDecibelConverter
{
public float LinearToDecibel(float linear)
{
float dB;
@made-indrayana
made-indrayana / ReadOnlyAttribute.cs
Created August 6, 2021 14:33
Read Only attribute for Unity's Inspector
// ReadOnlyAttribute.cs
// Author: Made Indrayana
// MIT License
// Variables with this attribute will be shown in Inspector but will be grayed out and not editable.
using UnityEngine;
public class ReadOnlyAttribute : PropertyAttribute { }
@made-indrayana
made-indrayana / pointer-reference.cpp
Created August 6, 2021 14:29
This program is created to display the usage of pass-by-value, pass-by-reference and pointer in C++.
// main.cpp
// Reference and Co.
// Author: Made Indrayana
// MIT License
// This program is created to display the usage of pass-by-value, pass-by-reference and pointer in C++.
#include <iostream>
using namespace std;